thoughtbot/shoulda-matchers — pull request #542 by dougo (2014-06-12 22:31:55+00:00)
Title: Allow multiple StrongParametersMatchers to exist at once.

The provided RSpec example looks a bit contrived, but it corresponds to this perfectly reasonable Minitest test case that was not working:
```
class UserControllerTest < ActionController::TestCase
should permit(:name).for(:create)
should_not permit(:name).for(:create)
end
```
This instantiates two matchers at class load time, which resulted in the second one overriding the double collection of the first one. Then when the tests are executed, the first matcher would fail, because its double is not listening to ActionController::Params#permit -- only the second matcher's double collection gets activated.

This is fixed by registering the double collection right before matching, rather than when the matcher is instantiated.