Awesome
QueryMatchers
Match the number of queries performed in any block of code. Allows setting in place regression tests for database performance.
Installation
Add this line to your application's Gemfile:
gem 'query_matchers'
And then execute:
$ bundle
Or install it yourself as:
$ gem install query_matchers
Usage
require 'query_matchers'
describe "something" do
include QueryMatchers
it "works!" do
expect { magician.magic! }.to execute_queries(43)
expect { does_not_hit_the_database }.to execute_no_queries
expect { hits_the_database_once }.to execute_one_query
end
end
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request