Class Spec::Matchers::BeSameAs

  1. lib/spec/matchers/be.rb
Parent: Spec::Matchers::Be

Public class methods

new (*args, &block)
[show source]
# File lib/spec/matchers/be.rb, line 183
      def initialize(*args, &block)
        @expected = args.shift
        @args = args
      end

Public instance methods

description ()
[show source]
# File lib/spec/matchers/be.rb, line 201
      def description
        "be #{expected_to_sentence}#{args_to_sentence}"
      end
failure_message_for_should ()
[show source]
# File lib/spec/matchers/be.rb, line 193
      def failure_message_for_should
        "expected #{@expected}, got #{@actual.inspect}"
      end
failure_message_for_should_not ()
[show source]
# File lib/spec/matchers/be.rb, line 197
      def failure_message_for_should_not
        "expected not #{@expected}, got #{@actual.inspect}"
      end
matches? (actual)
[show source]
# File lib/spec/matchers/be.rb, line 188
      def matches?(actual)
        @actual = actual
        @actual.equal?(@expected)
      end