Module: RSpec::Matchers::BuiltIn::BaseMatcher::DefaultFailureMessages Private

Included in:
RSpec::Matchers::BuiltIn::BaseMatcher, DSL::DefaultImplementations
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)

Instance Method Details

- (String) failure_message

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.

Returns:

  • (String)
106
107
108
# File 'lib/rspec/matchers/built_in/base_matcher.rb', line 106
def failure_message
  "expected #{actual.inspect} to #{description}"
end

- (String) failure_message_when_negated

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.

Returns:

  • (String)
115
116
117
# File 'lib/rspec/matchers/built_in/base_matcher.rb', line 115
def failure_message_when_negated
  "expected #{actual.inspect} not to #{description}"
end