Skip to content

Files

Latest commit

 

History

History
25 lines (17 loc) · 517 Bytes

RSpec-MissingExpectationTargetMethod.md

File metadata and controls

25 lines (17 loc) · 517 Bytes

Pattern: Missing use of .to/not_to/to_not

Issue: -

Description

Checks if .to, not_to or to_not are used.

Examples

# bad
expect(something).kind_of? Foo
is_expected == 42
expect{something}.eq? BarError

# good
expect(something).to be_a Foo
is_expected.to eq 42
expect{something}.to raise_error BarError

Further Reading