Sha256: e2239c8b3c21076af86ddd2e6a6b8b1bc4112705a9b85c8fa40d0d1ff8778cf5

Contents?: true

Size: 1.35 KB

Versions: 44

Compression:

Stored size: 1.35 KB

Contents

#! /usr/bin/env ruby
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
      Facter.stubs(:value).with(:operatingsystem).returns '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
      Facter.stubs(:value).with(:operatingsystem).returns '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
      Facter.stubs(:value).with(:operatingsystem).returns '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
      Facter.stubs(:value).with(:operatingsystem).returns '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

44 entries across 44 versions & 1 rubygems

Version Path
puppet-6.0.0 spec/integration/provider/service/init_spec.rb
puppet-6.0.0-x86-mingw32 spec/integration/provider/service/init_spec.rb
puppet-6.0.0-x64-mingw32 spec/integration/provider/service/init_spec.rb
puppet-6.0.0-universal-darwin spec/integration/provider/service/init_spec.rb