Class: Surrogate::RSpec::PredicateMatcher::FailureMessageShouldNotWithTimes

Inherits:
AbstractFailureMessage show all
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_messageObject



60
61
62
63
64
65
66
67
# File 'lib/surrogate/rspec/predicate_matcher.rb', line 60

def get_message
  message = "should not have been asked if #{ method_name } #{ times_msg expected_times_invoked } with #{ inspect_arguments expected_invocation }, "
  if times_invoked.zero?
     message << "was never asked"
  else
    message << "was asked #{times_msg times_invoked}"
  end
end