Skip to content

Files

Latest commit

 

History

History
38 lines (27 loc) · 864 Bytes

RSpec-VerifiedDoubles.md

File metadata and controls

38 lines (27 loc) · 864 Bytes

Pattern: Missing use of verifying double

Issue: -

Description

Prefer using verifying doubles over normal doubles.

Examples

# bad
let(:foo) do
  double(method_name: 'returned value')
end

# bad
let(:foo) do
  double("ClassName", method_name: 'returned value')
end

# good
let(:foo) do
  instance_double("ClassName", method_name: 'returned value')
end

Configurable attributes

Name Default value Configurable values
IgnoreNameless true Boolean
IgnoreSymbolicNames false Boolean

Further Reading