Method: RSpec::Matchers#equal

Defined in:
lib/rspec/matchers.rb

#equal(expected) ⇒ Object Also known as: an_object_equal_to, equal_to

Passes if actual.equal?(expected) (object identity).

See http://www.ruby-doc.org/core/classes/Object.html#M001057 for more information about equality in Ruby.

Examples:

expect(5).to       equal(5)   # Integers are equal
expect("5").not_to equal("5") # Strings that look the same are not the same object


586
587
588
# File 'lib/rspec/matchers.rb', line 586

def equal(expected)
  BuiltIn::Equal.new(expected)
end