Browse files

Added failing test for comparing symbol operator with an instance of …

…another class
  • Loading branch information...
1 parent 8b52b96 commit 5e1281ae14069e8c21896b1fd4636be446ac7ad6 @joeljunstrom joeljunstrom committed Aug 23, 2011
Showing with 9 additions and 3 deletions.
  1. +9 −3 test/test_symbol_operator.rb
View
12 test/test_symbol_operator.rb
@@ -17,18 +17,24 @@ class SymbolOperatorTest < Test::Unit::TestCase
should "be true if field and operator are equal" do
SymbolOperator.new(:foo, 'in').should == SymbolOperator.new(:foo, 'in')
end
-
+
should "be false if fields are equal but operators are not" do
SymbolOperator.new(:foo, 'in').should_not == SymbolOperator.new(:foo, 'all')
end
-
+
should "be false if operators are equal but fields are not" do
SymbolOperator.new(:foo, 'in').should_not == SymbolOperator.new(:bar, 'in')
end
-
+
should "be false if neither are equal" do
SymbolOperator.new(:foo, 'in').should_not == SymbolOperator.new(:bar, 'all')
end
+
+ should "be false if other isn't an symbol operator" do
+ assert_nothing_raised do
+ SymbolOperator.new(:foo, 'in').should_not == 'foo.in'
+ end
+ end
end
context "<=>" do

0 comments on commit 5e1281a

Please sign in to comment.