From 3270fd2cd94e6ca637bbae5f2acfc9c1824d76e2 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Sat, 19 Jan 2013 20:45:57 -0600 Subject: ENV.with_build_environment --- Library/Homebrew/test/test_ENV.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'Library/Homebrew/test') diff --git a/Library/Homebrew/test/test_ENV.rb b/Library/Homebrew/test/test_ENV.rb index 8e69cb6f0..1a1dd922b 100644 --- a/Library/Homebrew/test/test_ENV.rb +++ b/Library/Homebrew/test/test_ENV.rb @@ -26,4 +26,13 @@ class EnvironmentTests < Test::Unit::TestCase assert_nil ENV['LD'] assert_equal ENV['OBJC'], ENV['CC'] end + + def test_with_build_environment + before = ENV.to_hash + ENV.with_build_environment do + ENV['foo'] = 'bar' + end + assert_nil ENV['foo'] + assert_equal before, ENV.to_hash + end end -- cgit v1.2.3