Module: RSpec::Rails::Matchers::BaseMatcher::DefaultFailureMessages Private
Do not use. This module is for internal use only.
Overview
Provides default implementations of failure messages, based on the #description.
Class Method Summary
- .has_default_failure_messages?(matcher) ⇒ Boolean Internal use only
Instance Method Summary
-
#failure_message ⇒ String
Internal use only
Provides a good generic failure message.
-
#failure_message_when_negated ⇒ String
Internal use only
Provides a good generic negative failure message.
Class Method Details
.has_default_failure_messages?(matcher) ⇒ Boolean
# File 'rspec-rails/lib/rspec/rails/matchers/base_matcher.rb', line 167
def self. (matcher) matcher.method(: ).owner == self && matcher.method(: ).owner == self rescue NameError false end
Instance Method Details
#failure_message ⇒ String
Provides a good generic failure message. Based on RSpec::Rails::Matchers::BaseMatcher#description. When subclassing, if you are not satisfied with this failure message you often only need to override RSpec::Rails::Matchers::BaseMatcher#description.
# File 'rspec-rails/lib/rspec/rails/matchers/base_matcher.rb', line 153
def "expected #{description_of @actual} to #{description}".dup end
#failure_message_when_negated ⇒ String
Provides a good generic negative failure message. Based on RSpec::Rails::Matchers::BaseMatcher#description. When subclassing, if you are not satisfied with this failure message you often only need to override RSpec::Rails::Matchers::BaseMatcher#description.
# File 'rspec-rails/lib/rspec/rails/matchers/base_matcher.rb', line 162
def "expected #{description_of @actual} not to #{description}".dup end