aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test/test_build_options.rb
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew/test/test_build_options.rb')
-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