Skip to content

Commit

Permalink
Explicitly call out args passed into any_instance stubs.
Browse files Browse the repository at this point in the history
  • Loading branch information
dblock committed Sep 23, 2014
1 parent bc221e4 commit ceb965e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion features/old_syntax/any_instance.feature
Expand Up @@ -71,7 +71,7 @@ Feature: `any_instance`
"""ruby
RSpec.describe "Stubbing any instance of a class" do
it 'yields the receiver to the block implementation' do
Array.any_instance.stub(:shuffle) do |array|
Array.any_instance.stub(:shuffle) do |array, *args|
array.unshift(array.pop)
end
Expand Down
4 changes: 2 additions & 2 deletions features/working_with_legacy_code/any_instance.feature
Expand Up @@ -12,7 +12,7 @@ Feature: Any Instance
These methods add the appropriate stub or expectation to all instances of `Widget`.

This feature is sometimes useful when working with legacy code, though in general we
discourage its use for a number of reasons:
discourage its use for a number of reasons:

* The `rspec-mocks` API is designed for individual object instances, but this feature
operates on entire classes of objects. As a result there are some sematically confusing
Expand Down Expand Up @@ -81,7 +81,7 @@ Feature: Any Instance
"""ruby
RSpec.describe "allow_any_instance_of" do
it 'yields the receiver to the block implementation' do
allow_any_instance_of(Array).to receive(:shuffle) do |array|
allow_any_instance_of(Array).to receive(:shuffle) do |array, *args|
array.unshift(array.pop)
end
Expand Down

0 comments on commit ceb965e

Please sign in to comment.