lib/assay/assertions/identity_failure.rb in assay-0.2.0 vs lib/assay/assertions/identity_failure.rb in assay-0.3.0

- old
+ new

@@ -25,10 +25,11 @@ exp.object_id == act.object_id end # def to_s + return @mesg if @mesg return super unless @arguments.size == 2 iexp = @arguments[0].inspect iact = @arguments[1].inspect @@ -46,21 +47,19 @@ # Passes if +actual+ .equal? +expected+ (i.e. they are the same instance). # # o = Object.new # assert_identical(o, o) # - def assert_identical(exp, act, opts={}) - opts[:backtrace] ||= caller - IdentityFailure.assert(exp, act, opts) + def assert_identical(exp, act, msg=nil) + IdentityFailure.assert(exp, act, :message=>msg, :backtrace=>caller) end # Passes if ! actual .equal? expected # # assert_not_identical(Object.new, Object.new) # - def assert_not_identical(exp, act, opts={}) - opts[:backtrace] ||= caller - IdentityFailure.refute(exp, act, opts) + def assert_not_identical(exp, act, msg=nil) + IdentityFailure.refute(exp, act, :message=>msg, :backtrace=>caller) end end module Matchers