5 def initialize(expected)
11 @actual.equal?(@expected)
15 return "expected #{@expected.inspect}, got #{@actual.inspect} (using .equal?)", @expected, @actual
18 def negative_failure_message
19 return "expected #{@actual.inspect} not to equal #{@expected.inspect} (using .equal?)", @expected, @actual
23 "equal #{@expected.inspect}"
28 # should equal(expected)
29 # should_not equal(expected)
31 # Passes if actual and expected are the same object (object identity).
33 # See http://www.ruby-doc.org/core/classes/Object.html#M001057 for more information about equality in Ruby.
37 # 5.should equal(5) #Fixnums are equal
38 # "5".should_not equal("5") #Strings that look the same are not the same object
40 Matchers::Equal.new(expected)