Class: Matchy::Expectations::BeExpectation

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



10
11
12
# File 'lib/matchy/built_in/truth_expectations.rb', line 10

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

#matches?(receiver) ⇒ Boolean

Returns:

  • (Boolean)


4
5
6
7
8
# File 'lib/matchy/built_in/truth_expectations.rb', line 4

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

#negative_failure_messageObject



14
15
16
# File 'lib/matchy/built_in/truth_expectations.rb', line 14

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