Module: ProxyPacRb::RSpecMatchers::BaseMatcher::DefaultFailureMessages Private

Included in:
ProxyPacRb::RSpecMatchers::BaseMatcher
Defined in:
lib/proxy_pac_rb/rspec/matchers/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

Instance Method Summary collapse

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



170
171
172
173
174
175
# File 'lib/proxy_pac_rb/rspec/matchers/base_matcher.rb', line 170

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

Instance Method Details

#failure_messageString

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`.



155
156
157
# File 'lib/proxy_pac_rb/rspec/matchers/base_matcher.rb', line 155

def failure_message
  "expected #{description_of @actual} to #{description}"
end

#failure_message_when_negatedString

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`.



164
165
166
# File 'lib/proxy_pac_rb/rspec/matchers/base_matcher.rb', line 164

def failure_message_when_negated
  "expected #{description_of @actual} not to #{description}"
end