Sha256: 1a745ec035bd2ce37077086b47ef748b399aff4310967230d8c47b71c6758efd

Contents?: true

Size: 1.01 KB

Versions: 5

Compression:

Stored size: 1.01 KB

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

5 entries across 5 versions & 1 rubygems

Version Path
puppet-0.25.5 spec/unit/type/cron.rb
puppet-0.25.4 spec/unit/type/cron.rb
puppet-0.25.3 spec/unit/type/cron.rb
puppet-0.25.2 spec/unit/type/cron.rb
puppet-0.25.1 spec/unit/type/cron.rb