Class: RSpec::Matchers::BuiltIn::YieldWithNoArgs
- Inherits:
-
BaseMatcher
- Object
- BaseMatcher
- RSpec::Matchers::BuiltIn::YieldWithNoArgs
- Defined in:
- lib/rspec/matchers/built_in/yield.rb
Instance Attribute Summary
Attributes inherited from BaseMatcher
#actual, #expected, #rescued_exception
Instance Method Summary collapse
- #failure_message_for_should ⇒ Object
- #failure_message_for_should_not ⇒ Object
- #matches?(block) ⇒ Boolean
Methods inherited from BaseMatcher
#==, #description, #diffable?, #initialize, #match_unless_raises
Methods included from Pretty
#_pretty_print, #expected_to_sentence, #name, #name_to_sentence, #split_words, #to_sentence, #underscore
Constructor Details
This class inherits a constructor from RSpec::Matchers::BuiltIn::BaseMatcher
Instance Method Details
#failure_message_for_should ⇒ Object
89 90 91 |
# File 'lib/rspec/matchers/built_in/yield.rb', line 89 def "expected given block to yield with no arguments, but #{failure_reason}" end |
#failure_message_for_should_not ⇒ Object
93 94 95 |
# File 'lib/rspec/matchers/built_in/yield.rb', line 93 def "expected given block not to yield with no arguments, but did" end |
#matches?(block) ⇒ Boolean
84 85 86 87 |
# File 'lib/rspec/matchers/built_in/yield.rb', line 84 def matches?(block) @probe = YieldProbe.probe(block) @probe.yielded_once?(:yield_with_no_args) && @probe.single_yield_args.empty? end |