Sha256: a507918498a46a5a7830988198faf9ba7767c7a03a238b8e4dbfacfdeab50051

Contents?: true

Size: 745 Bytes

Versions: 16

Compression:

Stored size: 745 Bytes

Contents

#!/usr/bin/env ruby

require File.dirname(__FILE__) + '/../lib/puppettest'

require 'puppet'
require 'puppettest'

class TestPuppetUtilExecution < Test::Unit::TestCase
    include PuppetTest

    def test_withenv
        ENV["testing"] = "yay"

        assert_nothing_raised do
            Puppet::Util::Execution.withenv :testing => "foo" do
                $ran = ENV["testing"]
            end
        end

        assert_equal("yay", ENV["testing"])
        assert_equal("foo", $ran)

        ENV["rah"] = "yay"
        assert_raise(ArgumentError) do
            Puppet::Util::Execution.withenv :testing => "foo" do
                raise ArgumentError, "yay"
            end
        end

        assert_equal("yay", ENV["rah"])
    end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
puppet-0.25.5 test/util/execution.rb
puppet-0.25.4 test/util/execution.rb
puppet-0.25.3 test/util/execution.rb
puppet-0.24.9 test/util/execution.rb
puppet-0.25.2 test/util/execution.rb
puppet-0.25.1 test/util/execution.rb
puppet-0.25.0 test/util/execution.rb
puppet-0.24.0 test/util/execution.rb
puppet-0.24.2 test/util/execution.rb
puppet-0.24.1 test/util/execution.rb
puppet-0.24.3 test/util/execution.rb
puppet-0.24.4 test/util/execution.rb
puppet-0.24.5 test/util/execution.rb
puppet-0.24.6 test/util/execution.rb
puppet-0.24.7 test/util/execution.rb
puppet-0.24.8 test/util/execution.rb