From b2ccbfe6af2adaf7cc4f0e2af691f428704d5658 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Thu, 27 Feb 2014 14:22:42 -0600 Subject: Add set union to Options --- Library/Homebrew/test/test_options.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Library/Homebrew/test') diff --git a/Library/Homebrew/test/test_options.rb b/Library/Homebrew/test/test_options.rb index 493aa100a..741581a01 100644 --- a/Library/Homebrew/test/test_options.rb +++ b/Library/Homebrew/test/test_options.rb @@ -126,6 +126,13 @@ class OptionsTests < Test::Unit::TestCase assert_equal [foo], (@options & options).to_a end + def test_set_union + foo, bar, baz = %w{foo bar baz}.map { |o| Option.new(o) } + options = Options.new << foo << bar + @options << foo << baz + assert_equal [foo, bar, baz].sort, (@options | options).to_a.sort + end + def test_coerce_with_options assert_same @options, Options.coerce(@options) end -- cgit v1.2.3