Module: Aruba::Matchers::BaseMatcher::DefaultFailureMessages Private
- Included in:
- Aruba::Matchers::BaseMatcher
- Defined in:
- lib/aruba/matchers/base/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
.
Class Method Summary collapse
-
.has_default_failure_messages?(matcher) ⇒ Boolean
private
rubocop:disable Style/PredicateName.
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.
Class Method Details
.has_default_failure_messages?(matcher) ⇒ Boolean
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.
rubocop:disable Style/PredicateName
76 77 78 79 80 81 |
# File 'lib/aruba/matchers/base/base_matcher.rb', line 76 def self.(matcher) matcher.method(:failure_message).owner == self && matcher.method(:failure_message_when_negated).owner == self rescue NameError false end |
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
.
61 62 63 |
# File 'lib/aruba/matchers/base/base_matcher.rb', line 61 def "expected #{description_of @actual} to #{description}" 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
.
70 71 72 |
# File 'lib/aruba/matchers/base/base_matcher.rb', line 70 def "expected #{description_of @actual} not to #{description}" end |