Skip to content

Files

Latest commit

 

History

History
45 lines (31 loc) · 912 Bytes

RSpec-ClassCheck.md

File metadata and controls

45 lines (31 loc) · 912 Bytes

Pattern: Inconsistent use of be_a/be_kind_of

Issue: -

Description

Enforces consistent use of be_a or be_kind_of.

Examples

EnforcedStyle: be_a (default)

# bad
expect(object).to be_kind_of(String)
expect(object).to be_a_kind_of(String)

# good
expect(object).to be_a(String)
expect(object).to be_an(String)

EnforcedStyle: be_kind_of

# bad
expect(object).to be_a(String)
expect(object).to be_an(String)

# good
expect(object).to be_kind_of(String)
expect(object).to be_a_kind_of(String)

Configurable attributes

Name Default value Configurable values
EnforcedStyle be_a be_a, be_kind_of

Further Reading