Class Spec::Matchers::Equal

  1. lib/spec/matchers/equal.rb
Parent: Object

Public class methods

new (expected)
[show source]
# File lib/spec/matchers/equal.rb, line 5
      def initialize(expected)
        @expected = expected
      end

Public instance methods

description ()
[show source]
# File lib/spec/matchers/equal.rb, line 22
      def description
        "equal #{@expected.inspect}"
      end
failure_message_for_should ()
[show source]
# File lib/spec/matchers/equal.rb, line 14
      def failure_message_for_should
        return "expected #{@expected.inspect}, got #{@actual.inspect} (using .equal?)", @expected, @actual
      end
failure_message_for_should_not ()
[show source]
# File lib/spec/matchers/equal.rb, line 18
      def failure_message_for_should_not
        return "expected #{@actual.inspect} not to equal #{@expected.inspect} (using .equal?)", @expected, @actual
      end
matches? (actual)
[show source]
# File lib/spec/matchers/equal.rb, line 9
      def matches?(actual)
        @actual = actual
        @actual.equal?(@expected)
      end