Class: NotAMock::Matchers::AnythingMatcher
- Inherits:
-
CallMatcher
- Object
- CallMatcher
- NotAMock::Matchers::AnythingMatcher
- Defined in:
- lib/not_a_mock/matchers/anything_matcher.rb
Overview
Matcher for
object.should have_been_called
Instance Attribute Summary
Attributes inherited from CallMatcher
Instance Method Summary collapse
- #failure_message_without_parents ⇒ Object
-
#initialize(parent = nil) ⇒ AnythingMatcher
constructor
A new instance of AnythingMatcher.
- #matches_without_parents? ⇒ Boolean
Methods inherited from CallMatcher
#and_returned, #exactly, #failure_message, #matched?, #matches?, #negative_failure_message, #once, #twice, #with, #without_args
Constructor Details
#initialize(parent = nil) ⇒ AnythingMatcher
Returns a new instance of AnythingMatcher.
9 10 11 |
# File 'lib/not_a_mock/matchers/anything_matcher.rb', line 9 def initialize(parent = nil) super parent end |
Instance Method Details
#failure_message_without_parents ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/not_a_mock/matchers/anything_matcher.rb', line 18 def if matched? " was called" else " was never called" end end |
#matches_without_parents? ⇒ Boolean
13 14 15 16 |
# File 'lib/not_a_mock/matchers/anything_matcher.rb', line 13 def matches_without_parents? @calls = CallRecorder.instance.calls_by_object(@object) !@calls.empty? end |