aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test
diff options
context:
space:
mode:
authorJack Nagel2013-09-14 17:03:56 -0500
committerJack Nagel2013-09-14 17:03:56 -0500
commit8d88a52859a90bc6dafb9cef11d7f5b15b484e0c (patch)
tree86eb5061451538289a895268215ed4904e0ad3b9 /Library/Homebrew/test
parent2c00acf48ac031d8ac2085b5bfd1990f6525ca27 (diff)
downloadhomebrew-8d88a52859a90bc6dafb9cef11d7f5b15b484e0c.tar.bz2
Copies of BuildOptions should not share underlying collections
Diffstat (limited to 'Library/Homebrew/test')
-rw-r--r--Library/Homebrew/test/test_build_options.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/Library/Homebrew/test/test_build_options.rb b/Library/Homebrew/test/test_build_options.rb
index 38eeae22b..b5674ea50 100644
--- a/Library/Homebrew/test/test_build_options.rb
+++ b/Library/Homebrew/test/test_build_options.rb
@@ -71,4 +71,20 @@ class BuildOptionsTests < Test::Unit::TestCase
def test_actually_recognizes_implicit_options
assert @build.has_opposite_of?("--with-baz")
end
+
+ def test_copies_do_not_share_underlying_options
+ orig = BuildOptions.new []
+ copy = orig.dup
+ copy.add 'foo'
+ assert_empty orig
+ assert_equal 1, copy.count
+ end
+
+ def test_copies_do_not_share_underlying_args
+ orig = BuildOptions.new []
+ copy = orig.dup
+ copy.args << Option.new('foo')
+ assert_empty orig.args
+ assert_equal 1, copy.args.count
+ end
end