module RSpec::Matchers::DSL::DefaultImplementations

Defines default implementations of the matcher protocol methods for custom matchers. You can override any of these using the {RSpec::Matchers::DSL::Macros Macros} methods from within an `RSpec::Matchers.define` block.

Public Instance Methods

description() click to toggle source

The default description.

# File lib/rspec/matchers/dsl.rb, line 253
def description
  "#{name_to_sentence}#{to_sentence expected}"
end
diffable?() click to toggle source

@api private Used internally by objects returns by `should` and `should_not`.

# File lib/rspec/matchers/dsl.rb, line 248
def diffable?
  false
end
failure_message() click to toggle source

The default failure message for positive expectations.

# File lib/rspec/matchers/dsl.rb, line 258
def failure_message
  "expected #{actual.inspect} to #{name_to_sentence}#{to_sentence expected}"
end
failure_message_when_negated() click to toggle source

The default failure message for negative expectations.

# File lib/rspec/matchers/dsl.rb, line 263
def failure_message_when_negated
  "expected #{actual.inspect} not to #{name_to_sentence}#{to_sentence expected}"
end
supports_block_expectations?() click to toggle source

Matchers do not support block expectations by default. You must opt-in.

# File lib/rspec/matchers/dsl.rb, line 269
def supports_block_expectations?
  false
end