X11Dependency objects: fix hash equality
This commit is contained in:
parent
fc2d403a82
commit
fe3e802c50
@ -34,4 +34,8 @@ class X11Dependency < Requirement
|
|||||||
return unless X11Dependency === other
|
return unless X11Dependency === other
|
||||||
min_version <=> other.min_version
|
min_version <=> other.min_version
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def eql?(other)
|
||||||
|
super && min_version == other.min_version
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -19,6 +19,13 @@ class X11DependencyTests < Homebrew::TestCase
|
|||||||
assert !y.eql?(x)
|
assert !y.eql?(x)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_different_min_version
|
||||||
|
x = X11Dependency.new
|
||||||
|
y = X11Dependency.new("x11", %w[2.5])
|
||||||
|
refute x.eql?(y)
|
||||||
|
refute y.eql?(x)
|
||||||
|
end
|
||||||
|
|
||||||
def test_x_env
|
def test_x_env
|
||||||
x = X11Dependency.new
|
x = X11Dependency.new
|
||||||
x.stubs(:satisfied?).returns(true)
|
x.stubs(:satisfied?).returns(true)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user