Sha256: 26501a2c3c71f99b415d82f7a29305d26d926b428cf1add6012703af4641e092

Contents?: true

Size: 811 Bytes

Versions: 10

Compression:

Stored size: 811 Bytes

Contents

module RSpec
  module Matchers
    # Passes if +actual.eql?(expected)+
    #
    # 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)
      Matcher.new :eql, expected do |_expected_|

        diffable

        match do |actual|
          actual.eql?(_expected_)
        end

        failure_message_for_should do |actual|
          <<-MESSAGE

expected #{_expected_.inspect}
     got #{actual.inspect}

(compared using eql?)
MESSAGE
        end

        failure_message_for_should_not do |actual|
          <<-MESSAGE

expected #{actual.inspect} not to equal #{_expected_.inspect}

(compared using eql?)
MESSAGE
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 3 rubygems

Version Path
horseman-0.0.4 vendor/ruby/1.9.1/gems/rspec-expectations-2.7.0/lib/rspec/matchers/eql.rb
horseman-0.0.3 vendor/ruby/1.9.1/gems/rspec-expectations-2.7.0/lib/rspec/matchers/eql.rb
horseman-0.0.2 vendor/ruby/1.9.1/gems/rspec-expectations-2.7.0/lib/rspec/matchers/eql.rb
nutshell-crm-0.0.6.alpha vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/eql.rb
nutshell-crm-0.0.5 vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/eql.rb
nutshell-crm-0.0.4 vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/eql.rb
nutshell-crm-0.0.3 vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/eql.rb
nutshell-crm-0.0.2 vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/eql.rb
nutshell-crm-0.0.1 vendor/bundle/gems/rspec-expectations-2.7.0/lib/rspec/matchers/eql.rb
rspec-expectations-2.7.0 lib/rspec/matchers/eql.rb