Class: RSpec::Matchers::BuiltIn::Satisfy
- Inherits:
-
Object
- Object
- RSpec::Matchers::BuiltIn::Satisfy
- Includes:
- MatchAliases
- 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)
Methods included from MatchAliases
Constructor Details
- (Satisfy) initialize
A new instance of Satisfy
7 8 9 |
# File 'lib/rspec/matchers/built_in/satisfy.rb', line 7 def initialize(&block) @block = block end |
Instance Method Details
- (Object) description
25 26 27 |
# File 'lib/rspec/matchers/built_in/satisfy.rb', line 25 def description "satisfy block" end |
- (Object) failure_message_for_should
17 18 19 |
# File 'lib/rspec/matchers/built_in/satisfy.rb', line 17 def "expected #{@actual} to satisfy block" end |
- (Object) failure_message_for_should_not
21 22 23 |
# File 'lib/rspec/matchers/built_in/satisfy.rb', line 21 def "expected #{@actual} not to satisfy block" end |
- (Boolean) matches?(actual)
11 12 13 14 15 |
# File 'lib/rspec/matchers/built_in/satisfy.rb', line 11 def matches?(actual, &block) @block = block if block @actual = actual @block.call(actual) end |