Class: Matchy::Expectations::SatisfyExpectation

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



111
112
113
# File 'lib/matchy/built_in/truth_expectations.rb', line 111

def failure_message
  "Expected #{@receiver.inspect} to satisfy given block."
end

#matches?(receiver) ⇒ Boolean

Returns:



106
107
108
109
# File 'lib/matchy/built_in/truth_expectations.rb', line 106

def matches?(receiver)
  @receiver = receiver
  @expected.call(receiver) == true
end

#negative_failure_messageObject



115
116
117
# File 'lib/matchy/built_in/truth_expectations.rb', line 115

def negative_failure_message
  "Expected #{@receiver.inspect} to not satisfy given block."
end