Closed akostadinov closed 1 year ago
I think, this one is very similar to constant queries matcher. Maybe we can extend it like this instead?
expect { subject }.to perform_constant_number_of_queries(exactly: 1)
There is some issue that I'll fix somehow, when I'm able to reproduce locally. But could you tell me if you like how code looks now?
I merged the rspec matchers. But left the minitest assertion because it doesn't seem to reuse much code. Is this fine with you or you want also minitest to use a parameter instead of a new assertion?
Finally merged and released (see 0.7.1, it also includes some other minor things we discussed a while ago).
I changed the final API for Minitest: similarly to RSpec, I extended the existing #assert_perform_constant_number_of_queries
API to support passing the exact number: we just pass a positional argument
assert_perform_constant_number_of_queries(2, **options) do
get :index
end
fixes #56
Not doing the whole checklist to see if feature is accepted as it is now.
Checklist