Sha256: 78a94c9849755cead586d11f276607af3533ccf5c69282138daf0e724060acf4

Contents?: true

Size: 1.26 KB

Versions: 16

Compression:

Stored size: 1.26 KB

Contents

#!/usr/bin/env ruby

require File.dirname(__FILE__) + '/../../../spec_helper'

provider_class = Puppet::Type.type(:service).provider(:freebsd)

describe provider_class do
  before :each do
    @provider = provider_class.new
    @provider.stubs(:initscript)
  end

  it "should correctly parse rcvar for FreeBSD < 7" do
    @provider.stubs(:execute).returns <<OUTPUT
# ntpd
$ntpd_enable=YES
OUTPUT
    @provider.rcvar.should == ['# ntpd', 'ntpd_enable=YES']
  end

  it "should correctly parse rcvar for FreeBSD 7 to 8" do
    @provider.stubs(:execute).returns <<OUTPUT
# ntpd
ntpd_enable=YES
OUTPUT
    @provider.rcvar.should == ['# ntpd', 'ntpd_enable=YES']
  end

  it "should correctly parse rcvar for FreeBSD >= 8.1" do
    @provider.stubs(:execute).returns <<OUTPUT
# ntpd
#
ntpd_enable="YES"
#   (default: "")
OUTPUT
    @provider.rcvar.should == ['# ntpd', 'ntpd_enable="YES"', '#   (default: "")']
  end

  it "should find the right rcvar_value for FreeBSD < 7" do
    @provider.stubs(:rcvar).returns(['# ntpd', 'ntpd_enable=YES'])

    @provider.rcvar_value.should == "YES"
  end

  it "should find the right rcvar_value for FreeBSD >= 7" do
    @provider.stubs(:rcvar).returns(['# ntpd', 'ntpd_enable="YES"', '#   (default: "")'])

    @provider.rcvar_value.should == "YES"
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
puppet-2.6.18 spec/unit/provider/service/freebsd_spec.rb
puppet-2.6.17 spec/unit/provider/service/freebsd_spec.rb
puppet-2.6.16 spec/unit/provider/service/freebsd_spec.rb
puppet-2.6.15 spec/unit/provider/service/freebsd_spec.rb
puppet-2.6.14 spec/unit/provider/service/freebsd_spec.rb
puppet-2.6.13 spec/unit/provider/service/freebsd_spec.rb
puppet-2.6.12 spec/unit/provider/service/freebsd_spec.rb
puppet-2.6.11 spec/unit/provider/service/freebsd_spec.rb
puppet-2.6.10 spec/unit/provider/service/freebsd_spec.rb
puppet-2.6.9 spec/unit/provider/service/freebsd_spec.rb
puppet-2.6.8 spec/unit/provider/service/freebsd_spec.rb
puppet-2.6.7 spec/unit/provider/service/freebsd_spec.rb
puppet-2.6.6 spec/unit/provider/service/freebsd_spec.rb
puppet-2.6.5 spec/unit/provider/service/freebsd_spec.rb
puppet-2.6.4 spec/unit/provider/service/freebsd_spec.rb
puppet-2.6.3 spec/unit/provider/service/freebsd_spec.rb