Skip to content

Commit

Permalink
Merge pull request #848 from schwern/docs/message-chain-cop
Browse files Browse the repository at this point in the history
Fix RSpec/MessageChain "better" docs.
  • Loading branch information
Darhazer authored Dec 13, 2019
2 parents 49d616e + 5d0b0fc commit 28131fe
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/rubocop/cop/rspec/message_chain.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module RSpec
#
# # better
# thing = Thing.new(baz: 42)
# allow(foo).to receive(bar: thing)
# allow(foo).to receive(:bar).and_return(thing)
#
class MessageChain < Cop
MSG = 'Avoid stubbing using `%<method>s`.'
Expand Down
2 changes: 1 addition & 1 deletion manual/cops_rspec.md
Original file line number Diff line number Diff line change
Expand Up @@ -1846,7 +1846,7 @@ allow(foo).to receive_message_chain(:bar, :baz).and_return(42)

# better
thing = Thing.new(baz: 42)
allow(foo).to receive(bar: thing)
allow(foo).to receive(:bar).and_return(thing)
```

### References
Expand Down

0 comments on commit 28131fe

Please sign in to comment.