summaryrefslogtreecommitdiff
path: root/spec/integration/provider/service/systemd_spec.rb
blob: b48eb06f31047da28244a80eb71801b46284e356 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#! /usr/bin/env ruby

require 'spec_helper'

describe Puppet::Type.type(:service).provider(:systemd), '(integration)' do
  # TODO: Unfortunately there does not seem a way to stub the executable
  #       checks in the systemd provider because they happen at load time.
  it "should be considered suitable if /bin/systemctl is present", :if => File.executable?('/bin/systemctl') do
    described_class.should be_suitable
  end

  it "should be considered suitable if /usr/bin/systemctl is present", :if => File.executable?('/usr/bin/systemctl')  do
    described_class.should be_suitable
  end

  it "should not be cosidered suitable if systemctl is absent",
    :unless => (File.executable?('/bin/systemctl') or File.executable?('/usr/bin/systemctl')) do
    described_class.should_not be_suitable
  end
end