Sha256: 1fa7953e67412a4279f924bcd40e3fa6fcb98e0ffe2506a1428ae041c751822f
Contents?: true
Size: 681 Bytes
Versions: 35
Compression:
Stored size: 681 Bytes
Contents
#!/usr/bin/env ruby require File.expand_path(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
35 entries across 35 versions & 3 rubygems