Skip to content

Commit dc4cd28

Browse files
authored
Better explanation for MessageSpies
1 parent bb046eb commit dc4cd28

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/rubocop/cop/rspec/message_spies.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,22 @@ module RSpec
1212
#
1313
# # bad
1414
# expect(foo).to receive(:bar)
15+
# subject
1516
#
1617
# # good
18+
# allow(foo).to receive(:bar) # or use instance_spy
19+
# subject
1720
# expect(foo).to have_received(:bar)
1821
#
1922
# @example `EnforcedStyle: receive`
2023
#
2124
# # bad
25+
# subject
2226
# expect(foo).to have_received(:bar)
2327
#
2428
# # good
2529
# expect(foo).to receive(:bar)
30+
# subject
2631
#
2732
class MessageSpies < Base
2833
include ConfigurableEnforcedStyle

0 commit comments

Comments
 (0)