class RSpec::Matchers::BuiltIn::Eq

@api private Provides the implementation for ‘eq`. Not intended to be instantiated directly.

Public Instance Methods

description() click to toggle source

@api private @return [String]

# File lib/rspec/matchers/built_in/eq.rb, line 26
def description
  "eq #{expected_formatted}"
end
diffable?() click to toggle source

@api private @return [Boolean]

# File lib/rspec/matchers/built_in/eq.rb, line 32
def diffable?
  true
end
failure_message() click to toggle source

@api private @return [String]

# File lib/rspec/matchers/built_in/eq.rb, line 10
def failure_message
  if string_encoding_differs?
    "\nexpected: #{format_encoding(expected)} #{expected_formatted}\n     got: #{format_encoding(actual)} #{actual_formatted}\n\n(compared using ==)\n"
  else
    "\nexpected: #{expected_formatted}\n     got: #{actual_formatted}\n\n(compared using ==)\n"
  end
end
failure_message_when_negated() click to toggle source

@api private @return [String]

# File lib/rspec/matchers/built_in/eq.rb, line 20
def failure_message_when_negated
  "\nexpected: value != #{expected_formatted}\n     got: #{actual_formatted}\n\n(compared using ==)\n"
end

Private Instance Methods

match(expected, actual) click to toggle source
# File lib/rspec/matchers/built_in/eq.rb, line 38
def match(expected, actual)
  actual == expected
end