Sha256: cc551f0d428cdd0bb65cb208ec48f1624cc4fcf776c450d4b64c8bce3df77081

Contents?: true

Size: 1.47 KB

Versions: 68

Compression:

Stored size: 1.47 KB

Contents

require 'spec_helper'

test_title = 'Integration Tests for Puppet::Type::Service::Provider::Init'

describe test_title, unless: Puppet::Util::Platform.jruby? do
  let(:provider) { Puppet::Type.type(:service).provider(:init) }

  describe "when running on FreeBSD" do
    before :each do
      allow(Facter).to receive(:value).with(:operatingsystem).and_return('FreeBSD')
      allow(Facter).to receive(:value).with(:osfamily).and_return('FreeBSD')
    end

    it "should set its default path to include /etc/rc.d and /usr/local/etc/rc.d" do
      expect(provider.defpath).to eq(["/etc/rc.d", "/usr/local/etc/rc.d"])
    end
  end

  describe "when running on HP-UX" do
    before :each do
      allow(Facter).to receive(:value).with(:operatingsystem).and_return('HP-UX')
    end

    it "should set its default path to include /sbin/init.d" do
      expect(provider.defpath).to eq("/sbin/init.d")
    end
  end

  describe "when running on Archlinux" do
    before :each do
      allow(Facter).to receive(:value).with(:operatingsystem).and_return('Archlinux')
    end

    it "should set its default path to include /etc/rc.d" do
      expect(provider.defpath).to eq("/etc/rc.d")
    end
  end

  describe "when not running on FreeBSD, HP-UX or Archlinux" do
    before :each do
      allow(Facter).to receive(:value).with(:operatingsystem).and_return('RedHat')
    end

    it "should set its default path to include /etc/init.d" do
      expect(provider.defpath).to eq("/etc/init.d")
    end
  end
end

Version data entries

68 entries across 68 versions & 1 rubygems

Version Path
puppet-6.17.0 spec/integration/provider/service/init_spec.rb
puppet-6.17.0-x86-mingw32 spec/integration/provider/service/init_spec.rb
puppet-6.17.0-x64-mingw32 spec/integration/provider/service/init_spec.rb
puppet-6.17.0-universal-darwin spec/integration/provider/service/init_spec.rb
puppet-6.16.0 spec/integration/provider/service/init_spec.rb
puppet-6.16.0-x86-mingw32 spec/integration/provider/service/init_spec.rb
puppet-6.16.0-x64-mingw32 spec/integration/provider/service/init_spec.rb
puppet-6.16.0-universal-darwin spec/integration/provider/service/init_spec.rb
puppet-6.15.0 spec/integration/provider/service/init_spec.rb
puppet-6.15.0-x86-mingw32 spec/integration/provider/service/init_spec.rb
puppet-6.15.0-x64-mingw32 spec/integration/provider/service/init_spec.rb
puppet-6.15.0-universal-darwin spec/integration/provider/service/init_spec.rb
puppet-6.14.0 spec/integration/provider/service/init_spec.rb
puppet-6.14.0-x86-mingw32 spec/integration/provider/service/init_spec.rb
puppet-6.14.0-x64-mingw32 spec/integration/provider/service/init_spec.rb
puppet-6.14.0-universal-darwin spec/integration/provider/service/init_spec.rb
puppet-6.13.0 spec/integration/provider/service/init_spec.rb
puppet-6.13.0-x86-mingw32 spec/integration/provider/service/init_spec.rb
puppet-6.13.0-x64-mingw32 spec/integration/provider/service/init_spec.rb
puppet-6.13.0-universal-darwin spec/integration/provider/service/init_spec.rb