Class: Micronaut::Matchers::Satisfy
- Defined in:
- lib/micronaut/matchers/satisfy.rb
Overview
:nodoc:
Instance Method Summary collapse
- #failure_message ⇒ Object
-
#initialize(&block) ⇒ Satisfy
constructor
A new instance of Satisfy.
- #matches?(given, &block) ⇒ Boolean
- #negative_failure_message ⇒ Object
Constructor Details
#initialize(&block) ⇒ Satisfy
Returns a new instance of Satisfy.
6 7 8 |
# File 'lib/micronaut/matchers/satisfy.rb', line 6 def initialize(&block) @block = block end |
Instance Method Details
#failure_message ⇒ Object
16 17 18 |
# File 'lib/micronaut/matchers/satisfy.rb', line 16 def "expected #{@given} to satisfy block" end |
#matches?(given, &block) ⇒ Boolean
10 11 12 13 14 |
# File 'lib/micronaut/matchers/satisfy.rb', line 10 def matches?(given, &block) @block = block if block @given = given @block.call(given) end |
#negative_failure_message ⇒ Object
20 21 22 |
# File 'lib/micronaut/matchers/satisfy.rb', line 20 def "expected #{@given} not to satisfy block" end |