Sha256: 327ffecfd6b85c0202309e0d591c35a74b98c405e8a18e5806a5e888941974d1

Contents?: true

Size: 957 Bytes

Versions: 8

Compression:

Stored size: 957 Bytes

Contents

#!/usr/bin/env ruby

Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }

describe Puppet::Type.type(:cron) do
  before do
    @cron = Puppet::Type.type(:cron).new( :name => "foo" )
  end

  it "it should accept an :environment that looks like a path" do
    lambda do
      @cron[:environment] = 'PATH=/bin:/usr/bin:/usr/sbin'
    end.should_not raise_error
  end

  it "should not accept environment variables that do not contain '='" do
    lambda do
      @cron[:environment] = "INVALID"
    end.should raise_error(Puppet::Error)
  end

  it "should accept empty environment variables that do not contain '='" do
    lambda do
      @cron[:environment] = "MAILTO="
    end.should_not raise_error(Puppet::Error)
  end

  it "should accept 'absent'" do
    lambda do
      @cron[:environment] = 'absent'
    end.should_not raise_error(Puppet::Error)
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
puppet-2.6.7 spec/unit/type/cron_spec.rb
puppet-2.6.6 spec/unit/type/cron_spec.rb
puppet-2.6.5 spec/unit/type/cron_spec.rb
puppet-2.6.4 spec/unit/type/cron_spec.rb
puppet-2.6.3 spec/unit/type/cron_spec.rb
puppet-2.6.2 spec/unit/type/cron_spec.rb
puppet-2.6.1 spec/unit/type/cron_spec.rb
puppet-2.6.0 spec/unit/type/cron_spec.rb