Class: Surrogate::RSpec::PredicateMatcher::FailureMessageShouldWith
- Inherits:
-
AbstractFailureMessage
- Object
- AbstractFailureMessage
- Surrogate::RSpec::PredicateMatcher::FailureMessageShouldWith
- Defined in:
- lib/surrogate/rspec/predicate_matcher.rb
Instance Attribute Summary
Attributes inherited from AbstractFailureMessage
#invocations, #method_name, #times_predicate, #with_filter
Instance Method Summary collapse
Methods inherited from AbstractFailureMessage
#expected_invocation, #expected_times_invoked, #initialize, #inspect_arguments, #times_invoked, #times_msg
Constructor Details
This class inherits a constructor from Surrogate::RSpec::AbstractFailureMessage
Instance Method Details
#get_message ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/surrogate/rspec/predicate_matcher.rb', line 13 def = "should have been asked if #{ method_name } with #{ inspect_arguments expected_invocation }, but " if times_invoked.zero? << "was never asked" else inspected_invocations = invocations.map { |invocation| inspect_arguments invocation } << "got #{inspected_invocations.join ', '}" end end |