Option does not need to be Comparable
This commit is contained in:
parent
7d8a901f7a
commit
aad09a5a63
@ -1,8 +1,6 @@
|
||||
require 'set'
|
||||
|
||||
class Option
|
||||
include Comparable
|
||||
|
||||
attr_reader :name, :description, :flag
|
||||
|
||||
def initialize(name, description=nil)
|
||||
@ -20,9 +18,10 @@ class Option
|
||||
name <=> other.name
|
||||
end
|
||||
|
||||
def eql?(other)
|
||||
def ==(other)
|
||||
instance_of?(other.class) && name == other.name
|
||||
end
|
||||
alias_method :eql?, :==
|
||||
|
||||
def hash
|
||||
name.hash
|
||||
|
||||
@ -21,7 +21,6 @@ class OptionTests < Homebrew::TestCase
|
||||
refute_equal bar, @option
|
||||
assert_eql @option, foo
|
||||
refute_eql @option, bar
|
||||
assert_operator bar, :<, foo
|
||||
end
|
||||
|
||||
def test_strips_leading_dashes
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user