Remove Options#concat

This commit is contained in:
Jack Nagel 2014-08-13 18:16:25 -05:00
parent 0d6ceaf86e
commit 2311181b54
2 changed files with 0 additions and 25 deletions

View File

@ -116,11 +116,6 @@ class Options
any? { |opt| opt == o || opt.name == o || opt.flag == o } any? { |opt| opt == o || opt.name == o || opt.flag == o }
end end
def concat(o)
@options.merge(o)
self
end
alias_method :to_ary, :to_a alias_method :to_ary, :to_a
def inspect def inspect

View File

@ -98,26 +98,6 @@ class OptionsTests < Homebrew::TestCase
assert_equal [option], @options.to_ary assert_equal [option], @options.to_ary
end end
def test_concat_array
option = Option.new("foo")
@options.concat([option])
assert_includes @options, option
assert_equal [option], @options.to_a
end
def test_concat_options
option = Option.new("foo")
opts = Options.new
opts << option
@options.concat(opts)
assert_includes @options, option
assert_equal [option], @options.to_a
end
def test_concat_returns_self
assert_same @options, (@options.concat([]))
end
def test_intersection def test_intersection
foo, bar, baz = %w{foo bar baz}.map { |o| Option.new(o) } foo, bar, baz = %w{foo bar baz}.map { |o| Option.new(o) }
options = Options.new << foo << bar options = Options.new << foo << bar