-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit e5827f0
Showing
15 changed files
with
199 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
engines: | ||
bundler-audit: | ||
enabled: true | ||
duplication: | ||
enabled: true | ||
config: | ||
languages: | ||
- ruby | ||
fixme: | ||
enabled: true | ||
rubocop: | ||
enabled: true | ||
ratings: | ||
paths: | ||
- "**.rb" | ||
exclude_paths: | ||
- spec/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/.bundle/ | ||
/.yardoc | ||
/Gemfile.lock | ||
/_yardoc/ | ||
/coverage/ | ||
/doc/ | ||
/pkg/ | ||
/spec/reports/ | ||
/tmp/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--require spec_helper | ||
--format documentation | ||
--color |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
AllCops: | ||
DisplayCopNames: true | ||
DisplayStyleGuide: true | ||
StyleGuideCopsOnly: true | ||
TargetRubyVersion: 2.3 | ||
|
||
Metrics/ParameterLists: | ||
Max: 5 | ||
|
||
Style/Alias: | ||
Enabled: false | ||
|
||
Style/ClassAndModuleChildren: | ||
EnforcedStyle: compact | ||
|
||
Style/FileName: | ||
Enabled: false | ||
|
||
Style/FrozenStringLiteralComment: | ||
Enabled: false | ||
|
||
Style/ModuleFunction: | ||
Enabled: false | ||
|
||
Style/StringLiterals: | ||
EnforcedStyle: double_quotes | ||
|
||
Style/StringLiteralsInInterpolation: | ||
EnforcedStyle: double_quotes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
sudo: false | ||
language: ruby | ||
cache: bundler | ||
script: | ||
- bundle exec rspec | ||
- bundle exec rubocop | ||
rvm: | ||
- 2.3.0 | ||
- ruby-head | ||
before_install: gem install bundler | ||
matrix: | ||
allow_failures: | ||
- rvm: ruby-head |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
source "https://rubygems.org" | ||
|
||
# Specify your gem's dependencies in tram-form.gemspec | ||
gemspec | ||
|
||
group :test, :development do | ||
gem "pry" | ||
gem "pry-byebug" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2017 Andrew Kozin (nepalez), Evil Martians | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Rspec::Sqlimit | ||
|
||
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/rspec/sqlimit`. To experiment with that code, run `bin/console` for an interactive prompt. | ||
|
||
TODO: Delete this and the text above, and describe your gem | ||
|
||
## Installation | ||
|
||
Add this line to your application's Gemfile: | ||
|
||
```ruby | ||
gem 'rspec-sqlimit' | ||
``` | ||
|
||
And then execute: | ||
|
||
$ bundle | ||
|
||
Or install it yourself as: | ||
|
||
$ gem install rspec-sqlimit | ||
|
||
## Usage | ||
|
||
TODO: Write usage instructions here | ||
|
||
## Development | ||
|
||
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment. | ||
|
||
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org). | ||
|
||
## Contributing | ||
|
||
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/rspec-sqlimit. | ||
|
||
|
||
## License | ||
|
||
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT). | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
require "bundler/gem_tasks" | ||
require "rspec/core/rake_task" | ||
|
||
RSpec::Core::RakeTask.new(:spec) | ||
|
||
task default: :spec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
require_relative "rspec/sqlimit" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
require "active_record" | ||
require "rspec" | ||
|
||
module RSpec::SQLimit | ||
require_relative "sqlimit/counter" | ||
end | ||
|
||
RSpec::Matchers.define :exceed_query_limit do | ||
match do |block| | ||
end | ||
end |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
Gem::Specification.new do |gem| | ||
gem.name = "rspec-sqlimit" | ||
gem.version = "0.0.1" | ||
gem.author = "Andrew Kozin (nepalez)" | ||
gem.email = "andrew.kozin@gmail.com" | ||
gem.homepage = "https://github.com/nepalez/rspec-sqlimit" | ||
gem.summary = "RSpec matcher to control SQL queries made by block of code" | ||
gem.license = "MIT" | ||
|
||
gem.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR) | ||
gem.test_files = gem.files.grep(/^spec/) | ||
gem.extra_rdoc_files = Dir["README.md", "LICENSE", "CHANGELOG.md"] | ||
|
||
gem.required_ruby_version = ">= 2.3" | ||
|
||
gem.add_runtime_dependency "activerecord", "> 4.0", "< 6.0" | ||
gem.add_runtime_dependency "rspec", "~> 3.0" | ||
|
||
gem.add_development_dependency "rake" | ||
gem.add_development_dependency "rubocop", "~> 0.44" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
require "spec_helper" | ||
|
||
describe RSpec::SQLimit do | ||
it "does something useful" do | ||
expect(false).to eq(true) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
require "pry" | ||
require "rspec-sqlimit" | ||
|
||
RSpec.configure do |config| | ||
config.order = :random | ||
config.filter_run focus: true | ||
config.run_all_when_everything_filtered = true | ||
end |