Sha256: 789420ff48fa7e8bee656775b8bef85fb45dab706d71635be13b4471adb420db

Contents?: true

Size: 958 Bytes

Versions: 169

Compression:

Stored size: 958 Bytes

Contents

module RSpec
  module Matchers
    module BuiltIn
      class Equal
        include BaseMatcher

        def matches?(actual)
          super(actual).equal?(expected)
        end

        def failure_message_for_should
          return <<-MESSAGE

expected #{inspect_object(expected)}
     got #{inspect_object(actual)}

Compared using equal?, which compares object identity,
but expected and actual are not the same object. Use
'actual.should == expected' if you don't care about
object identity in this example.

MESSAGE
        end

        def failure_message_for_should_not
          return <<-MESSAGE

expected not #{inspect_object(actual)}
         got #{inspect_object(expected)}

Compared using equal?, which compares object identity.

MESSAGE
        end

        def diffable?
          true
        end

      private

        def inspect_object(o)
          "#<#{o.class}:#{o.object_id}> => #{o.inspect}"
        end
      end
    end
  end
end

Version data entries

169 entries across 71 versions & 9 rubygems

Version Path
classiccms-0.3.1 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/built_in/equal.rb
classiccms-0.3.1 vendor/bundle/gems/rspec-expectations-2.10.0/lib/rspec/matchers/built_in/equal.rb
classiccms-0.3.0 vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/built_in/equal.rb
classiccms-0.3.0 vendor/bundle/gems/rspec-expectations-2.9.1/lib/rspec/matchers/built_in/equal.rb
classiccms-0.3.0 vendor/bundle/gems/rspec-expectations-2.10.0/lib/rspec/matchers/built_in/equal.rb
sunrise-cms-0.3.0.rc vendor/bundle/ruby/1.9.1/gems/rspec-expectations-2.10.0/lib/rspec/matchers/built_in/equal.rb
sunrise-cms-0.3.0.rc vendor/bundle/ruby/1.9.1/gems/rails-uploader-0.0.1/vendor/bundle/ruby/1.9.1/gems/rspec-expectations-2.10.0/lib/rspec/matchers/built_in/equal.rb
rails-uploader-0.0.1 vendor/bundle/ruby/1.9.1/gems/rspec-expectations-2.10.0/lib/rspec/matchers/built_in/equal.rb
resque-pool-0.3.0 vendor/bundle/ruby/1.8/gems/rspec-expectations-2.9.0/lib/rspec/matchers/built_in/equal.rb
resque-pool-0.3.0 vendor/bundle/ruby/1.8/gems/rspec-expectations-2.9.1/lib/rspec/matchers/built_in/equal.rb
ftl-0.2.0 vendor/bundle/gems/rspec-expectations-2.10.0/lib/rspec/matchers/built_in/equal.rb
classiccms-0.2.4.pre vendor/bundle/gems/rspec-expectations-2.9.0/lib/rspec/matchers/built_in/equal.rb
classiccms-0.2.4.pre vendor/bundle/gems/rspec-expectations-2.9.1/lib/rspec/matchers/built_in/equal.rb
classiccms-0.2.4.pre vendor/bundle/gems/rspec-expectations-2.10.0/lib/rspec/matchers/built_in/equal.rb
rspec-expectations-2.10.0 lib/rspec/matchers/built_in/equal.rb
horseman-0.0.5 vendor/ruby/1.9.1/gems/rspec-expectations-2.9.1/lib/rspec/matchers/built_in/equal.rb
frameworks-capybara-0.2.0.rc6 vendor/bundle/ruby/1.8/gems/rspec-expectations-2.9.0/lib/rspec/matchers/built_in/equal.rb
frameworks-capybara-0.2.0.rc5 vendor/bundle/ruby/1.8/gems/rspec-expectations-2.9.0/lib/rspec/matchers/built_in/equal.rb
rspec-expectations-2.9.1 lib/rspec/matchers/built_in/equal.rb
frameworks-capybara-0.2.0.rc4 vendor/bundle/ruby/1.8/gems/rspec-expectations-2.9.0/lib/rspec/matchers/built_in/equal.rb