@api private Provides default implementations of failure messages, based on the `description`.
@private
# File lib/rspec/matchers/built_in/base_matcher.rb, line 169 def self.has_default_failure_messages?(matcher) matcher.method(:failure_message).owner == self && matcher.method(:failure_message_when_negated).owner == self rescue NameError false end
@api private Provides a good generic failure message. Based on `description`. When subclassing, if you are not satisfied with this failure message you often only need to override `description`. @return [String]
# File lib/rspec/matchers/built_in/base_matcher.rb, line 155 def failure_message "expected #{description_of @actual} to #{description}" end
@api private Provides a good generic negative failure message. Based on `description`. When subclassing, if you are not satisfied with this failure message you often only need to override `description`. @return [String]
# File lib/rspec/matchers/built_in/base_matcher.rb, line 164 def failure_message_when_negated "expected #{description_of @actual} not to #{description}" end