Reputation: 32721
After reading this article and this doc, I have questions regarding Ruby and RSpec equalities. Is the following assumption correct?
Ruby's == is equivalent to RSpec eq
Ruby's eql? is equivalent to RSpec eql
Ruby's equal? is equivalent to RSpec equal
Upvotes: 1
Views: 49
Reputation: 430514
From the docs:
a.should equal(b) # passes if a.equal?(b)
a.should eql(b) # passes if a.eql?(b)
a.should == b # passes if a == b
a.should be(b) # passes if a.equal?(b)
a.should eq(b) # passes if a == b
Upvotes: 2