aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test
diff options
context:
space:
mode:
authorJack Nagel2013-10-04 21:19:15 -0500
committerJack Nagel2013-10-04 21:19:15 -0500
commit86e6ff5e8044cb1f784c9c54c940e2bf269ec558 (patch)
tree8c16d02860970f539cbf6738becaecafc732561f /Library/Homebrew/test
parent1f973c30844eb7634d75d8b559a9265f0fc6c8f7 (diff)
downloadhomebrew-86e6ff5e8044cb1f784c9c54c940e2bf269ec558.tar.bz2
Check types in Formula#==
Comparing two objects should not raise an exception, even if they have different types. The semantics of #== are now the same as #eql?, so make one an alias.
Diffstat (limited to 'Library/Homebrew/test')
-rw-r--r--Library/Homebrew/test/test_formula.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/Library/Homebrew/test/test_formula.rb b/Library/Homebrew/test/test_formula.rb
index 1591b425b..bc1e703eb 100644
--- a/Library/Homebrew/test/test_formula.rb
+++ b/Library/Homebrew/test/test_formula.rb
@@ -124,6 +124,10 @@ class FormulaTests < Test::Unit::TestCase
assert !y.eql?(x)
end
+ def test_comparison_with_non_formula_objects_does_not_raise
+ assert_not_equal TestBall.new, Object.new
+ end
+
def test_class_naming
assert_equal 'ShellFm', Formula.class_s('shell.fm')
assert_equal 'Fooxx', Formula.class_s('foo++')