aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/test/test_options.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/Library/Homebrew/test/test_options.rb b/Library/Homebrew/test/test_options.rb
index 0cc16ff2e..b0f560354 100644
--- a/Library/Homebrew/test/test_options.rb
+++ b/Library/Homebrew/test/test_options.rb
@@ -54,6 +54,15 @@ class OptionsTests < Test::Unit::TestCase
assert_equal 1, @options.count
end
+ def test_preserves_existing_member_when_pushing_duplicate
+ a = Option.new("foo", "bar")
+ b = Option.new("foo", "qux")
+ @options << a << b
+ assert_equal 1, @options.count
+ assert_same a, @options.first
+ assert_equal a.description, @options.first.description
+ end
+
def test_include
@options << Option.new("foo")
assert @options.include? "--foo"