Skip to content

Files

Latest commit

 

History

History
41 lines (27 loc) · 946 Bytes

RSpec-MessageSpies.md

File metadata and controls

41 lines (27 loc) · 946 Bytes

Pattern: Missing spy use for message expectation

Issue: -

Description

Checks that message expectations are set using spies.

This rule can be configured in your configuration using the EnforcedStyle option.

Examples

EnforcedStyle: have_received

# bad
expect(foo).to receive(:bar)

# good
expect(foo).to have_received(:bar)

EnforcedStyle: receive

# bad
expect(foo).to have_received(:bar)

# good
expect(foo).to receive(:bar)

Configurable attributes

Name Default value Configurable values
EnforcedStyle have_received have_received, receive

Further Reading