Sha256: ae8c911492c5baa6be4282925740b324a09022e11122c3753e1a9379c2e0b666
Contents?: true
Size: 1.03 KB
Versions: 17
Compression:
Stored size: 1.03 KB
Contents
module Spec module Matchers class Eql #:nodoc: def initialize(expected) @expected = expected end def matches?(given) @given = given @given.eql?(@expected) end def failure_message return "expected #{@expected.inspect}, got #{@given.inspect} (using .eql?)", @expected, @given end def negative_failure_message return "expected #{@given.inspect} not to equal #{@expected.inspect} (using .eql?)", @expected, @given end def description "eql #{@expected.inspect}" end end # :call-seq: # should eql(expected) # should_not eql(expected) # # Passes if given and expected are of equal value, but not necessarily the same object. # # See http://www.ruby-doc.org/core/classes/Object.html#M001057 for more information about equality in Ruby. # # == Examples # # 5.should eql(5) # 5.should_not eql(3) def eql(expected) Matchers::Eql.new(expected) end end end
Version data entries
17 entries across 17 versions & 5 rubygems