Module: RSpec::Matchers::BuiltIn::BaseMatcher::DefaultFailureMessages Private
- Defined in:
- lib/rspec/matchers/built_in/base_matcher.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Provides default implementations of failure messages, based on the description
.
Instance Method Summary collapse
-
#failure_message ⇒ String
private
Provides a good generic failure message.
-
#failure_message_when_negated ⇒ String
private
Provides a good generic negative failure message.
Instance Method Details
#failure_message ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
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
.
199 200 201 |
# File 'lib/rspec/matchers/built_in/base_matcher.rb', line 199 def "expected #{description_of @actual} to #{description}".dup end |
#failure_message_when_negated ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
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
.
208 209 210 |
# File 'lib/rspec/matchers/built_in/base_matcher.rb', line 208 def "expected #{description_of @actual} not to #{description}".dup end |