Sha256: ea6b5a6e7c745b22e9fd596d87d147de83d4b251690d2558a3038c5312071101

Contents?: true

Size: 868 Bytes

Versions: 18

Compression:

Stored size: 868 Bytes

Contents

module Spec
  module Matchers
  
    # :call-seq:
    #   should eql(expected)
    #   should_not eql(expected)
    #
    # Passes if actual 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)
      simple_matcher do |actual, matcher|
        matcher.failure_message          = "expected #{expected.inspect}, got #{actual.inspect} (using .eql?)", expected, actual
        matcher.negative_failure_message = "expected #{actual.inspect} not to equal #{expected.inspect} (using .eql?)", expected, actual
        matcher.description              = "eql #{expected.inspect}"
        actual.eql?(expected)
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 6 rubygems

Version Path
dchelimsky-rspec-1.1.11.1 lib/spec/matchers/eql.rb
dchelimsky-rspec-1.1.11.2 lib/spec/matchers/eql.rb
dchelimsky-rspec-1.1.11.3 lib/spec/matchers/eql.rb
dchelimsky-rspec-1.1.11.4 lib/spec/matchers/eql.rb
dchelimsky-rspec-1.1.11.5 lib/spec/matchers/eql.rb
dchelimsky-rspec-1.1.11.6 lib/spec/matchers/eql.rb
dchelimsky-rspec-1.1.11.7 lib/spec/matchers/eql.rb
dchelimsky-rspec-1.1.12 lib/spec/matchers/eql.rb
newbamboo-evented-rspec-1.1.12 lib/spec/matchers/eql.rb
newbamboo-rspec-1.1.12 lib/spec/matchers/eql.rb
mack-0.8.3.1 lib/gems/rspec-1.1.12/lib/spec/matchers/eql.rb
mack-0.8.3 lib/gems/rspec-1.1.12/lib/spec/matchers/eql.rb
rspec-1.1.12 lib/spec/matchers/eql.rb
spree-0.6.0 vendor/plugins/rspec/lib/spec/matchers/eql.rb
spree-0.7.0 vendor/plugins/rspec/lib/spec/matchers/eql.rb
spree-0.7.1 vendor/plugins/rspec/lib/spec/matchers/eql.rb
spree-0.8.0 vendor/plugins/rspec/lib/spec/matchers/eql.rb
spree-0.8.1 vendor/plugins/rspec/lib/spec/matchers/eql.rb