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