Skip to content

Files

Latest commit

 

History

History
23 lines (15 loc) · 488 Bytes

RSpec-IdenticalEqualityAssertion.md

File metadata and controls

23 lines (15 loc) · 488 Bytes

Pattern: Identical expressions on both sides of equality

Issue: -

Description

Checks for equality assertions with identical expressions on both sides.

Examples

# bad
expect(foo.bar).to eq(foo.bar)
expect(foo.bar).to eql(foo.bar)

# good
expect(foo.bar).to eq(2)
expect(foo.bar).to eql(2)

Further Reading