Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dasch/query_matchers
A set of RSpec matchers for Active Record queries
https://github.com/dasch/query_matchers
Last synced: about 16 hours ago
JSON representation
A set of RSpec matchers for Active Record queries
- Host: GitHub
- URL: https://github.com/dasch/query_matchers
- Owner: dasch
- License: mit
- Created: 2014-03-25T10:41:14.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2020-12-29T20:43:14.000Z (about 4 years ago)
- Last Synced: 2025-01-02T13:04:18.248Z (2 days ago)
- Language: Ruby
- Size: 21.5 KB
- Stars: 5
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# 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
```ruby
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
1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request