File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -2683,8 +2683,11 @@ This cop can be configured in your configuration using the
2683
2683
----
2684
2684
# bad
2685
2685
expect(foo).to receive(:bar)
2686
+ do_something
2686
2687
2687
2688
# good
2689
+ allow(foo).to receive(:bar) # or use instance_spy
2690
+ do_something
2688
2691
expect(foo).to have_received(:bar)
2689
2692
----
2690
2693
@@ -2693,10 +2696,13 @@ expect(foo).to have_received(:bar)
2693
2696
[source,ruby]
2694
2697
----
2695
2698
# bad
2699
+ allow(foo).to receive(:bar)
2700
+ do_something
2696
2701
expect(foo).to have_received(:bar)
2697
2702
2698
2703
# good
2699
2704
expect(foo).to receive(:bar)
2705
+ do_something
2700
2706
----
2701
2707
2702
2708
=== Configurable attributes
Original file line number Diff line number Diff line change @@ -12,17 +12,23 @@ module RSpec
12
12
#
13
13
# # bad
14
14
# expect(foo).to receive(:bar)
15
+ # do_something
15
16
#
16
17
# # good
18
+ # allow(foo).to receive(:bar) # or use instance_spy
19
+ # do_something
17
20
# expect(foo).to have_received(:bar)
18
21
#
19
22
# @example `EnforcedStyle: receive`
20
23
#
21
24
# # bad
25
+ # allow(foo).to receive(:bar)
26
+ # do_something
22
27
# expect(foo).to have_received(:bar)
23
28
#
24
29
# # good
25
30
# expect(foo).to receive(:bar)
31
+ # do_something
26
32
#
27
33
class MessageSpies < Base
28
34
include ConfigurableEnforcedStyle
You can’t perform that action at this time.
0 commit comments