Class: Matchy::Expectations::EqualExpectation

Inherits:
Base
  • Object
show all
Defined in:
lib/matchy/built_in/truth_expectations.rb

Instance Method Summary collapse

Methods inherited from Base

#fail!, #initialize, #pass!

Constructor Details

This class inherits a constructor from Matchy::Expectations::Base

Instance Method Details

#failure_messageObject



96
97
98
# File 'lib/matchy/built_in/truth_expectations.rb', line 96

def failure_message
  "Expected #{@receiver.inspect} to equal #{@expected.inspect}."
end

#matches?(receiver) ⇒ Boolean

Returns:



91
92
93
94
# File 'lib/matchy/built_in/truth_expectations.rb', line 91

def matches?(receiver)
  @receiver = receiver
  @expected.equal?(receiver)
end

#negative_failure_messageObject



100
101
102
# File 'lib/matchy/built_in/truth_expectations.rb', line 100

def negative_failure_message
  "Expected #{@receiver.inspect} to not equal #{@expected.inspect}."
end