Class: RSpec::Matchers::Satisfy
- Inherits:
-
Object
- Object
- RSpec::Matchers::Satisfy
- Defined in:
- lib/rspec/matchers/satisfy.rb
Overview
:nodoc:
Instance Method Summary collapse
- #description ⇒ Object
- #failure_message_for_should ⇒ Object
- #failure_message_for_should_not ⇒ Object
-
#initialize(&block) ⇒ Satisfy
constructor
A new instance of Satisfy.
- #matches?(actual, &block) ⇒ Boolean
Constructor Details
#initialize(&block) ⇒ Satisfy
Returns a new instance of Satisfy.
5 6 7 |
# File 'lib/rspec/matchers/satisfy.rb', line 5 def initialize(&block) @block = block end |
Instance Method Details
#description ⇒ Object
23 24 25 |
# File 'lib/rspec/matchers/satisfy.rb', line 23 def description "satisfy block" end |
#failure_message_for_should ⇒ Object
15 16 17 |
# File 'lib/rspec/matchers/satisfy.rb', line 15 def "expected #{@actual} to satisfy block" end |
#failure_message_for_should_not ⇒ Object
19 20 21 |
# File 'lib/rspec/matchers/satisfy.rb', line 19 def "expected #{@actual} not to satisfy block" end |
#matches?(actual, &block) ⇒ Boolean
9 10 11 12 13 |
# File 'lib/rspec/matchers/satisfy.rb', line 9 def matches?(actual, &block) @block = block if block @actual = actual @block.call(actual) end |