Class: RSpec::Matchers::BuiltIn::Eq

Inherits:
BaseMatcher show all
Defined in:
lib/rspec/matchers/built_in/eq.rb

Instance Attribute Summary

Attributes inherited from BaseMatcher

#actual, #expected, #rescued_exception

Instance Method Summary collapse

Methods inherited from BaseMatcher

#==, #description, #initialize, #match_unless_raises, #matches?

Methods included from Pretty

#_pretty_print, #expected_to_sentence, #name, #name_to_sentence, #split_words, #to_sentence, #underscore

Constructor Details

This class inherits a constructor from RSpec::Matchers::BuiltIn::BaseMatcher

Instance Method Details

#diffable?Boolean

Returns:

  • (Boolean)


17
# File 'lib/rspec/matchers/built_in/eq.rb', line 17

def diffable?; true; end

#failure_message_for_shouldObject



9
10
11
# File 'lib/rspec/matchers/built_in/eq.rb', line 9

def failure_message_for_should
  "\nexpected: #{expected.inspect}\n     got: #{actual.inspect}\n\n(compared using ==)\n"
end

#failure_message_for_should_notObject



13
14
15
# File 'lib/rspec/matchers/built_in/eq.rb', line 13

def failure_message_for_should_not
  "\nexpected: value != #{expected.inspect}\n     got: #{actual.inspect}\n\n(compared using ==)\n"
end

#match(expected, actual) ⇒ Object



5
6
7
# File 'lib/rspec/matchers/built_in/eq.rb', line 5

def match(expected, actual)
  actual == expected
end