diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2660b23..74817d1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,55 +13,41 @@ jobs: fail-fast: false matrix: include: - - ruby: 2.5.8 - directory: 'spec/rails-3.2' - - ruby: 2.5.8 - directory: 'spec/rails-4.2' - - ruby: 2.5.8 - directory: 'spec/rails-5.2' - - ruby: 2.5.8 - directory: 'spec/rails-6.1' - - ruby: 2.6.6 - directory: 'spec/rails-4.2' - - ruby: 2.6.6 - directory: 'spec/rails-5.2' - - ruby: 2.6.6 - directory: 'spec/rails-6.1' - - ruby: 2.7.2 - directory: 'spec/rails-5.2' - - ruby: 2.7.2 - directory: 'spec/rails-6.1' - - ruby: 2.7.2 - directory: 'spec/rails-7.0' + - ruby: 2.7.8 + gemfile: Gemfile.6.1.sqlite + - ruby: 2.7.8 + gemfile: Gemfile.7.0.sqlite - ruby: 3.0.0 - directory: 'spec/rails-6.1' + gemfile: Gemfile.6.1.sqlite - ruby: 3.0.0 - directory: 'spec/rails-7.0' - - ruby: 3.1.1 - directory: 'spec/rails-6.1' - - ruby: 3.1.1 - directory: 'spec/rails-7.0' - - ruby: 3.1.1 - directory: 'spec/rails-7.1' - - ruby: 3.1.1 - directory: 'spec/rails-7.2' - - ruby: 3.3.3 - directory: 'spec/rails-7.0' - - ruby: 3.3.3 - directory: 'spec/rails-7.1' - - ruby: 3.3.3 - directory: 'spec/rails-7.2' + gemfile: Gemfile.7.0.sqlite + - ruby: 3.1.6 + gemfile: Gemfile.6.1.sqlite + - ruby: 3.1.6 + gemfile: Gemfile.7.0.sqlite + - ruby: 3.1.6 + gemfile: Gemfile.7.1.sqlite + - ruby: 3.1.6 + gemfile: Gemfile.7.2.sqlite + - ruby: 3.3.4 + gemfile: Gemfile.7.0.sqlite + - ruby: 3.3.4 + gemfile: Gemfile.7.1.sqlite + - ruby: 3.3.4 + gemfile: Gemfile.7.2.sqlite + - ruby: 3.3.4 + gemfile: Gemfile.8.0.sqlite + env: + BUNDLE_GEMFILE: "${{ matrix.gemfile }}" steps: - uses: actions/checkout@v2 - name: Install ruby uses: ruby/setup-ruby@v1 with: ruby-version: "${{ matrix.ruby }}" - - name: Install bundler - run: gem install bundler:1.17.3 - name: Bundle - run: bundle install - working-directory: "${{ matrix.directory }}" + run: | + gem install bundler:2.4.22 + bundle install --no-deployment - name: Run tests - run: bundle exec rake spec - working-directory: "${{ matrix.directory }}" + run: bundle exec rspec diff --git a/.gitignore b/.gitignore index 8c0f972..68e07e1 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,8 @@ doc pkg *.gem .idea +*.db +*.log +.bundle +spec/support/database.yml +.byebug_history diff --git a/.rspec b/.rspec new file mode 100644 index 0000000..83e16f8 --- /dev/null +++ b/.rspec @@ -0,0 +1,2 @@ +--color +--require spec_helper diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 0000000..94ff29c --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +3.1.1 diff --git a/Gemfile b/Gemfile new file mode 120000 index 0000000..346d5a4 --- /dev/null +++ b/Gemfile @@ -0,0 +1 @@ +Gemfile.7.0.sqlite \ No newline at end of file diff --git a/spec/rails-6.1/Gemfile b/Gemfile.6.1.sqlite similarity index 58% rename from spec/rails-6.1/Gemfile rename to Gemfile.6.1.sqlite index 5c3e8ac..f3a6e1a 100644 --- a/spec/rails-6.1/Gemfile +++ b/Gemfile.6.1.sqlite @@ -1,12 +1,20 @@ source 'https://rubygems.org' -gem 'sqlite3' +# Runtime dependencies gem 'rails', '=6.1.2.1' + +# Development dependencies gem 'rspec' gem 'rspec-rails' +gem 'sqlite3' gem 'database_cleaner' -gem 'query_diet', :path => '../..' gem 'capybara' +gem 'byebug' +gem 'gemika' + # For Ruby 3.1.1 gem 'matrix' gem 'net-smtp' + +# Gem under test +gem 'query_diet', :path => '.' diff --git a/spec/rails-6.1/Gemfile.lock b/Gemfile.6.1.sqlite.lock similarity index 98% rename from spec/rails-6.1/Gemfile.lock rename to Gemfile.6.1.sqlite.lock index 8fd79ab..f3a313c 100644 --- a/spec/rails-6.1/Gemfile.lock +++ b/Gemfile.6.1.sqlite.lock @@ -1,5 +1,5 @@ PATH - remote: ../.. + remote: . specs: query_diet (0.7.2) @@ -86,6 +86,7 @@ GEM database_cleaner-core (2.0.1) diff-lcs (1.4.4) erubi (1.10.0) + gemika (0.8.3) globalid (1.0.0) activesupport (>= 5.0) i18n (1.8.9) @@ -187,11 +188,12 @@ GEM zeitwerk (2.4.2) PLATFORMS - ruby + x86_64-linux DEPENDENCIES capybara database_cleaner + gemika matrix net-smtp query_diet! @@ -201,4 +203,4 @@ DEPENDENCIES sqlite3 BUNDLED WITH - 2.5.17 + 2.4.22 diff --git a/spec/rails-7.0/Gemfile b/Gemfile.7.0.sqlite similarity index 51% rename from spec/rails-7.0/Gemfile rename to Gemfile.7.0.sqlite index af86ce5..d78e8fd 100644 --- a/spec/rails-7.0/Gemfile +++ b/Gemfile.7.0.sqlite @@ -1,9 +1,16 @@ source 'https://rubygems.org' -gem 'sqlite3' +# Runtime dependencies gem 'rails', '=7.0.1' + +# Development dependencies gem 'rspec' gem 'rspec-rails' +gem 'sqlite3' gem 'database_cleaner' -gem 'query_diet', :path => '../..' gem 'capybara' +gem 'byebug' +gem 'gemika' + +# Gem under test +gem 'query_diet', :path => '.' diff --git a/spec/rails-7.0/Gemfile.lock b/Gemfile.7.0.sqlite.lock similarity index 98% rename from spec/rails-7.0/Gemfile.lock rename to Gemfile.7.0.sqlite.lock index 9ed01b1..450d6c1 100644 --- a/spec/rails-7.0/Gemfile.lock +++ b/Gemfile.7.0.sqlite.lock @@ -1,5 +1,5 @@ PATH - remote: ../.. + remote: . specs: query_diet (0.7.2) @@ -74,6 +74,7 @@ GEM addressable (2.8.0) public_suffix (>= 2.0.2, < 5.0) builder (3.3.0) + byebug (11.1.3) capybara (3.36.0) addressable matrix @@ -94,6 +95,7 @@ GEM diff-lcs (1.5.1) digest (3.1.0) erubi (1.13.0) + gemika (0.8.3) globalid (1.0.0) activesupport (>= 5.0) i18n (1.14.5) @@ -200,8 +202,10 @@ PLATFORMS x86_64-linux DEPENDENCIES + byebug capybara database_cleaner + gemika query_diet! rails (= 7.0.1) rspec @@ -209,4 +213,4 @@ DEPENDENCIES sqlite3 BUNDLED WITH - 2.5.17 + 2.4.22 diff --git a/spec/rails-7.1/Gemfile b/Gemfile.7.1.sqlite similarity index 53% rename from spec/rails-7.1/Gemfile rename to Gemfile.7.1.sqlite index b764cb5..397e619 100644 --- a/spec/rails-7.1/Gemfile +++ b/Gemfile.7.1.sqlite @@ -1,9 +1,16 @@ source 'https://rubygems.org' -gem 'sqlite3', '~> 1.7' +# Runtime dependencies gem 'rails', '=7.1.4' + +# Development dependencies gem 'rspec' gem 'rspec-rails' +gem 'sqlite3', '~> 1.7' gem 'database_cleaner' -gem 'query_diet', :path => '../..' gem 'capybara' +gem 'byebug' +gem 'gemika' + +# Gem under test +gem 'query_diet', :path => '.' diff --git a/spec/rails-7.1/Gemfile.lock b/Gemfile.7.1.sqlite.lock similarity index 98% rename from spec/rails-7.1/Gemfile.lock rename to Gemfile.7.1.sqlite.lock index 52a0b9a..4c4c1b3 100644 --- a/spec/rails-7.1/Gemfile.lock +++ b/Gemfile.7.1.sqlite.lock @@ -1,5 +1,5 @@ PATH - remote: ../.. + remote: . specs: query_diet (0.7.2) @@ -85,6 +85,7 @@ GEM base64 (0.2.0) bigdecimal (3.1.8) builder (3.3.0) + byebug (11.1.3) capybara (3.40.0) addressable matrix @@ -107,6 +108,7 @@ GEM diff-lcs (1.5.1) drb (2.2.1) erubi (1.13.0) + gemika (0.8.3) globalid (1.2.1) activesupport (>= 6.1) i18n (1.14.5) @@ -226,8 +228,10 @@ PLATFORMS x86_64-linux DEPENDENCIES + byebug capybara database_cleaner + gemika query_diet! rails (= 7.1.4) rspec diff --git a/spec/rails-7.2/Gemfile b/Gemfile.7.2.sqlite similarity index 53% rename from spec/rails-7.2/Gemfile rename to Gemfile.7.2.sqlite index 5fc5b39..680f4e5 100644 --- a/spec/rails-7.2/Gemfile +++ b/Gemfile.7.2.sqlite @@ -1,9 +1,16 @@ source 'https://rubygems.org' -gem 'sqlite3', '~> 1.7' +# Runtime dependencies gem 'rails', '=7.2.1' + +# Development dependencies gem 'rspec' gem 'rspec-rails' +gem 'sqlite3', '~> 1.7' gem 'database_cleaner' -gem 'query_diet', :path => '../..' gem 'capybara' +gem 'byebug' +gem 'gemika' + +# Gem under test +gem 'query_diet', :path => '.' diff --git a/spec/rails-7.2/Gemfile.lock b/Gemfile.7.2.sqlite.lock similarity index 98% rename from spec/rails-7.2/Gemfile.lock rename to Gemfile.7.2.sqlite.lock index 87a17ab..b87a535 100644 --- a/spec/rails-7.2/Gemfile.lock +++ b/Gemfile.7.2.sqlite.lock @@ -1,5 +1,5 @@ PATH - remote: ../.. + remote: . specs: query_diet (0.7.2) @@ -81,6 +81,7 @@ GEM base64 (0.2.0) bigdecimal (3.1.8) builder (3.3.0) + byebug (11.1.3) capybara (3.40.0) addressable matrix @@ -103,6 +104,7 @@ GEM diff-lcs (1.5.1) drb (2.2.1) erubi (1.13.0) + gemika (0.8.3) globalid (1.2.1) activesupport (>= 6.1) i18n (1.14.5) @@ -224,8 +226,10 @@ PLATFORMS x86_64-linux DEPENDENCIES + byebug capybara database_cleaner + gemika query_diet! rails (= 7.2.1) rspec diff --git a/Gemfile.8.0.sqlite b/Gemfile.8.0.sqlite new file mode 100644 index 0000000..a523848 --- /dev/null +++ b/Gemfile.8.0.sqlite @@ -0,0 +1,16 @@ +source 'https://rubygems.org' + +# Runtime dependencies +gem 'rails', '=8.0.1' + +# Development dependencies +gem 'rspec' +gem 'rspec-rails' +gem 'sqlite3', '~> 2.4' +gem 'database_cleaner' +gem 'capybara' +gem 'byebug' +gem 'gemika' + +# Gem under test +gem 'query_diet', :path => '.' diff --git a/Gemfile.8.0.sqlite.lock b/Gemfile.8.0.sqlite.lock new file mode 100644 index 0000000..7f43397 --- /dev/null +++ b/Gemfile.8.0.sqlite.lock @@ -0,0 +1,243 @@ +PATH + remote: . + specs: + query_diet (0.7.2) + +GEM + remote: https://rubygems.org/ + specs: + actioncable (8.0.1) + actionpack (= 8.0.1) + activesupport (= 8.0.1) + nio4r (~> 2.0) + websocket-driver (>= 0.6.1) + zeitwerk (~> 2.6) + actionmailbox (8.0.1) + actionpack (= 8.0.1) + activejob (= 8.0.1) + activerecord (= 8.0.1) + activestorage (= 8.0.1) + activesupport (= 8.0.1) + mail (>= 2.8.0) + actionmailer (8.0.1) + actionpack (= 8.0.1) + actionview (= 8.0.1) + activejob (= 8.0.1) + activesupport (= 8.0.1) + mail (>= 2.8.0) + rails-dom-testing (~> 2.2) + actionpack (8.0.1) + actionview (= 8.0.1) + activesupport (= 8.0.1) + nokogiri (>= 1.8.5) + rack (>= 2.2.4) + rack-session (>= 1.0.1) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + useragent (~> 0.16) + actiontext (8.0.1) + actionpack (= 8.0.1) + activerecord (= 8.0.1) + activestorage (= 8.0.1) + activesupport (= 8.0.1) + globalid (>= 0.6.0) + nokogiri (>= 1.8.5) + actionview (8.0.1) + activesupport (= 8.0.1) + builder (~> 3.1) + erubi (~> 1.11) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + activejob (8.0.1) + activesupport (= 8.0.1) + globalid (>= 0.3.6) + activemodel (8.0.1) + activesupport (= 8.0.1) + activerecord (8.0.1) + activemodel (= 8.0.1) + activesupport (= 8.0.1) + timeout (>= 0.4.0) + activestorage (8.0.1) + actionpack (= 8.0.1) + activejob (= 8.0.1) + activerecord (= 8.0.1) + activesupport (= 8.0.1) + marcel (~> 1.0) + activesupport (8.0.1) + base64 + benchmark (>= 0.3) + bigdecimal + concurrent-ruby (~> 1.0, >= 1.3.1) + connection_pool (>= 2.2.5) + drb + i18n (>= 1.6, < 2) + logger (>= 1.4.2) + minitest (>= 5.1) + securerandom (>= 0.3) + tzinfo (~> 2.0, >= 2.0.5) + uri (>= 0.13.1) + addressable (2.8.7) + public_suffix (>= 2.0.2, < 7.0) + base64 (0.2.0) + benchmark (0.4.0) + bigdecimal (3.1.8) + builder (3.3.0) + byebug (11.1.3) + capybara (3.40.0) + addressable + matrix + mini_mime (>= 0.1.3) + nokogiri (~> 1.11) + rack (>= 1.6.0) + rack-test (>= 0.6.3) + regexp_parser (>= 1.5, < 3.0) + xpath (~> 3.2) + concurrent-ruby (1.3.4) + connection_pool (2.4.1) + crass (1.0.6) + database_cleaner (2.0.2) + database_cleaner-active_record (>= 2, < 3) + database_cleaner-active_record (2.2.0) + activerecord (>= 5.a) + database_cleaner-core (~> 2.0.0) + database_cleaner-core (2.0.1) + date (3.4.1) + diff-lcs (1.5.1) + drb (2.2.1) + erubi (1.13.0) + gemika (0.8.3) + globalid (1.2.1) + activesupport (>= 6.1) + i18n (1.14.5) + concurrent-ruby (~> 1.0) + io-console (0.7.2) + irb (1.14.0) + rdoc (>= 4.0.0) + reline (>= 0.4.2) + logger (1.6.1) + loofah (2.22.0) + crass (~> 1.0.2) + nokogiri (>= 1.12.0) + mail (2.8.1) + mini_mime (>= 0.1.1) + net-imap + net-pop + net-smtp + marcel (1.0.4) + matrix (0.4.2) + mini_mime (1.1.5) + minitest (5.25.1) + net-imap (0.5.2) + date + net-protocol + net-pop (0.1.2) + net-protocol + net-protocol (0.2.2) + timeout + net-smtp (0.5.0) + net-protocol + nio4r (2.7.4) + nokogiri (1.16.7-x86_64-linux) + racc (~> 1.4) + psych (5.1.2) + stringio + public_suffix (6.0.1) + racc (1.8.1) + rack (3.1.7) + rack-session (2.0.0) + rack (>= 3.0.0) + rack-test (2.1.0) + rack (>= 1.3) + rackup (2.1.0) + rack (>= 3) + webrick (~> 1.8) + rails (8.0.1) + actioncable (= 8.0.1) + actionmailbox (= 8.0.1) + actionmailer (= 8.0.1) + actionpack (= 8.0.1) + actiontext (= 8.0.1) + actionview (= 8.0.1) + activejob (= 8.0.1) + activemodel (= 8.0.1) + activerecord (= 8.0.1) + activestorage (= 8.0.1) + activesupport (= 8.0.1) + bundler (>= 1.15.0) + railties (= 8.0.1) + rails-dom-testing (2.2.0) + activesupport (>= 5.0.0) + minitest + nokogiri (>= 1.6) + rails-html-sanitizer (1.6.0) + loofah (~> 2.21) + nokogiri (~> 1.14) + railties (8.0.1) + actionpack (= 8.0.1) + activesupport (= 8.0.1) + irb (~> 1.13) + rackup (>= 1.0.0) + rake (>= 12.2) + thor (~> 1.0, >= 1.2.2) + zeitwerk (~> 2.6) + rake (13.2.1) + rdoc (6.7.0) + psych (>= 4.0.0) + regexp_parser (2.9.2) + reline (0.5.9) + io-console (~> 0.5) + rspec (3.13.0) + rspec-core (~> 3.13.0) + rspec-expectations (~> 3.13.0) + rspec-mocks (~> 3.13.0) + rspec-core (3.13.1) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.2) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.13.0) + rspec-mocks (3.13.1) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.13.0) + rspec-rails (7.0.1) + actionpack (>= 7.0) + activesupport (>= 7.0) + railties (>= 7.0) + rspec-core (~> 3.13) + rspec-expectations (~> 3.13) + rspec-mocks (~> 3.13) + rspec-support (~> 3.13) + rspec-support (3.13.1) + securerandom (0.3.1) + sqlite3 (2.4.1-x86_64-linux-gnu) + stringio (3.1.1) + thor (1.3.2) + timeout (0.4.1) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + uri (1.0.2) + useragent (0.16.10) + webrick (1.8.1) + websocket-driver (0.7.6) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.5) + xpath (3.2.0) + nokogiri (~> 1.8) + zeitwerk (2.6.18) + +PLATFORMS + x86_64-linux + +DEPENDENCIES + byebug + capybara + database_cleaner + gemika + query_diet! + rails (= 8.0.1) + rspec + rspec-rails + sqlite3 (~> 2.4) + +BUNDLED WITH + 2.5.15 diff --git a/Gemfile.lock b/Gemfile.lock new file mode 120000 index 0000000..b4f4a7a --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1 @@ +Gemfile.7.0.sqlite.lock \ No newline at end of file diff --git a/MIT-LICENSE b/LICENSE similarity index 98% rename from MIT-LICENSE rename to LICENSE index 30adc46..dfea2a1 100644 --- a/MIT-LICENSE +++ b/LICENSE @@ -1,5 +1,7 @@ Copyright (c) 2009 Henning Koch +MIT License + 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 diff --git a/README.md b/README.md index 65a3033..750e2a9 100644 --- a/README.md +++ b/README.md @@ -85,15 +85,13 @@ Rails.application.config.content_security_policy do |policy| The gem is tested against -| Versions | Ruby 2.5.8 | Ruby 2.6.6 | Ruby 2.7.2 | Ruby 3.0.0 | Ruby 3.1.1 | Ruby 3.3.3 | -|-----------|:------------------:|:------------------:|:------------------:|:------------------:|:------------------:|:------------------:| -| Rails 3.2 | :heavy_check_mark: | :x: | :x: | :x: | :x: | :x: | -| Rails 4.2 | :heavy_check_mark: | :heavy_check_mark: | :x: | :x: | :x: | :x: | -| Rails 5.2 | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :x: | :x: | :x: | -| Rails 6.1 | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :x: | -| Rails 7.0 | :x: | :x: | :x: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | -| Rails 7.1 | :x: | :x: | :x: | :x: | :heavy_check_mark: | :heavy_check_mark: | -| Rails 7.2 | :x: | :x: | :x: | :x: | :heavy_check_mark: | :heavy_check_mark: | +| Versions | Ruby 2.7.8 | Ruby 3.0.0 | Ruby 3.1.6 | Ruby 3.3.4 | +|-----------|:------------------:|:------------------:|:------------------:|:------------------:| +| Rails 6.1 | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :x: | +| Rails 7.0 | :x: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | +| Rails 7.1 | :x: | :x: | :heavy_check_mark: | :heavy_check_mark: | +| Rails 7.2 | :x: | :x: | :heavy_check_mark: | :heavy_check_mark: | +| Rails 8.0 | :x: | :x: | :x: | :heavy_check_mark: | Later versions might work, earlier will not. diff --git a/Rakefile b/Rakefile index 8c56fa6..fe14dec 100644 --- a/Rakefile +++ b/Rakefile @@ -1,51 +1,10 @@ -require 'bundler/setup' +require 'rake' require 'bundler/gem_tasks' -desc 'Default: Run all specs.' -task :default => ['all:bundle:install', 'all:spec'] - -namespace :all do - desc "Run specs on all spec apps" - task :spec do - each_rails_version do |directory| - env = "SPEC=../../#{ENV['SPEC']} " if ENV['SPEC'] - sh("cd #{directory} && #{env} bundle exec rake spec") - end - end - - namespace :bundle do - desc "Bundle all spec apps" - task :install do - each_rails_version do |directory| - sh("cd #{directory} && (bundle check || bundle install --quiet)") - end - end - - desc "Update a gem given by the GEM environment variable" - task :update do - gem = ENV['GEM'] or raise "Name the gem you wish to update by setting a environment variable GEM" - each_rails_version do |directory| - sh("cd #{directory} && bundle update #{gem}") - end - end - end +begin + require 'gemika/tasks' +rescue LoadError + puts 'Run `gem install gemika` for additional tasks' end -def each_rails_version - Dir['spec/rails-*'].sort.each do |directory| - rails_version = /spec\/rails-(\d+\.\d+)/.match(directory)[1].to_f - if rails_version >= 7.2 && RUBY_VERSION < "3.1.0" - puts "Skipping #{directory} since rails 7.2+ is not supported on ruby #{RUBY_VERSION}" - elsif rails_version >= 7.0 && RUBY_VERSION < "2.7.0" - puts "Skipping #{directory} since rails 7+ is not supported on ruby #{RUBY_VERSION}" - elsif rails_version < 5.0 && RUBY_VERSION >= "2.7.0" - puts "Skipping #{directory} since rails < 5 is not supported on ruby #{RUBY_VERSION}" - elsif rails_version < 6.0 && RUBY_VERSION >= "3.0.0" - puts "Skipping #{directory} since rails < 6 is not supported on ruby #{RUBY_VERSION}" - else - puts '', "\033[44m#{directory}\033[0m", '' - unbundled_env_method = Bundler.respond_to?(:with_unbundled_env) ? :with_unbundled_env : :with_clean_env - Bundler.send(unbundled_env_method) { yield directory } - end - end -end +task :default => 'matrix:spec' diff --git a/lib/query_diet/active_record_ext.rb b/lib/query_diet/active_record_ext.rb index 9bbb31a..7eb3414 100644 --- a/lib/query_diet/active_record_ext.rb +++ b/lib/query_diet/active_record_ext.rb @@ -1,6 +1,6 @@ module QueryDiet module ActiveRecordExt - if RUBY_VERSION >= '3' + if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3') def log(query, *, **) QueryDiet::Logger.log(query) { super } end diff --git a/lib/query_diet/logger.rb b/lib/query_diet/logger.rb index 5a2ef03..a0223b1 100644 --- a/lib/query_diet/logger.rb +++ b/lib/query_diet/logger.rb @@ -1,3 +1,5 @@ +require 'benchmark' + module QueryDiet class Logger DEFAULT_OPTIONS = { :bad_count => 8, :bad_time => 5000 } diff --git a/lib/query_diet/widget.rb b/lib/query_diet/widget.rb index 54b7c3e..79113ed 100644 --- a/lib/query_diet/widget.rb +++ b/lib/query_diet/widget.rb @@ -50,21 +50,7 @@ def html(options) end end - - module Helper - def query_diet_widget(options = {}) - default_html_options = {:nonce => false} - options = options.reverse_merge(default_html_options) - - nonce_attribute = options.fetch(:nonce) ? " nonce=\"#{content_security_policy_nonce}\"" : '' - - html = Widget.css(nonce_attribute) + Widget.html(options) + Widget.js(nonce_attribute) - html.respond_to?(:html_safe) ? html.html_safe : html - end - end - end - end -ActionView::Base.send :include, QueryDiet::Widget::Helper +require 'query_diet/widget/helper' diff --git a/lib/query_diet/widget/helper.rb b/lib/query_diet/widget/helper.rb new file mode 100644 index 0000000..603f053 --- /dev/null +++ b/lib/query_diet/widget/helper.rb @@ -0,0 +1,19 @@ +module QueryDiet + module Widget + module Helper + + def query_diet_widget(options = {}) + default_html_options = {:nonce => false} + options = options.reverse_merge(default_html_options) + + nonce_attribute = options.fetch(:nonce) ? " nonce=\"#{content_security_policy_nonce}\"" : '' + + html = Widget.css(nonce_attribute) + Widget.html(options) + Widget.js(nonce_attribute) + html.respond_to?(:html_safe) ? html.html_safe : html + end + + end + end +end + +ActionView::Base.send :include, QueryDiet::Widget::Helper diff --git a/query_diet.gemspec b/query_diet.gemspec index 11cfe77..568cab8 100644 --- a/query_diet.gemspec +++ b/query_diet.gemspec @@ -1,14 +1,26 @@ -require './lib/query_diet/version' +$:.push File.expand_path("../lib", __FILE__) +require "query_diet/version" -Gem::Specification.new "query_diet", QueryDiet::VERSION do |gem| +Gem::Specification.new do |gem| + gem.name = 'query_diet' + gem.version = QueryDiet::VERSION gem.authors = ["Henning Koch", "Tobias Kraze"] gem.email = "github@makandra.de" - gem.description = "Rails database query counter that stays out of your way" - gem.summary = gem.description gem.homepage = "https://github.com/makandra/query_diet" + gem.summary = "Rails database query counter that stays out of your way" + gem.description = gem.summary gem.license = 'MIT' - gem.metadata = { 'rubygems_mfa_required' => 'true' } - gem.files = `git ls-files README.md MIT-LICENSE lib`.split($\) + gem.required_ruby_version = '>= 2.0.0' + gem.metadata = { + 'source_code_uri' => gem.homepage, + 'bug_tracker_uri' => gem.homepage + '/issues', + 'changelog_uri' => gem.homepage + '/blob/master/CHANGELOG.md', + 'rubygems_mfa_required' => 'true', + } + + gem.files = `git ls-files README.md MIT-LICENSE lib`.split($\) + gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n") + gem.require_paths = ["lib"] end diff --git a/spec/shared/spec/logger_spec.rb b/spec/query_diet/logger_spec.rb similarity index 99% rename from spec/shared/spec/logger_spec.rb rename to spec/query_diet/logger_spec.rb index 00d2a01..16801d7 100644 --- a/spec/shared/spec/logger_spec.rb +++ b/spec/query_diet/logger_spec.rb @@ -1,5 +1,3 @@ -require 'spec_helper' - describe QueryDiet::Logger do before do diff --git a/spec/shared/spec/helpers/widget_spec.rb b/spec/query_diet/widget/helper_spec.rb similarity index 97% rename from spec/shared/spec/helpers/widget_spec.rb rename to spec/query_diet/widget/helper_spec.rb index d18ecc0..86c2be7 100644 --- a/spec/shared/spec/helpers/widget_spec.rb +++ b/spec/query_diet/widget/helper_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe QueryDiet::Widget::Helper, :type => :helper do +describe QueryDiet::Widget::Helper, type: :helper do it "should be highlighted if the request was too intimate with the database" do QueryDiet::Logger.stub :bad? => true diff --git a/spec/rails-3.2/.gitignore b/spec/rails-3.2/.gitignore deleted file mode 100644 index af64fae..0000000 --- a/spec/rails-3.2/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -.bundle -db/*.sqlite3 -log/*.log -tmp/**/* diff --git a/spec/rails-3.2/.rspec b/spec/rails-3.2/.rspec deleted file mode 100644 index 89da67b..0000000 --- a/spec/rails-3.2/.rspec +++ /dev/null @@ -1,2 +0,0 @@ ---colour ---format progress diff --git a/spec/rails-3.2/Gemfile b/spec/rails-3.2/Gemfile deleted file mode 100644 index aea564c..0000000 --- a/spec/rails-3.2/Gemfile +++ /dev/null @@ -1,10 +0,0 @@ -source 'https://rubygems.org' - -gem 'sqlite3' -gem 'rails', '~>3.2' -gem 'rspec', '3.5.0.beta1' -gem 'rspec-rails', '3.5.0.beta1' -gem 'database_cleaner' -gem 'query_diet', :path => '../..' -gem 'test-unit-minitest' -gem 'capybara' diff --git a/spec/rails-3.2/Gemfile.lock b/spec/rails-3.2/Gemfile.lock deleted file mode 100644 index 9dfc187..0000000 --- a/spec/rails-3.2/Gemfile.lock +++ /dev/null @@ -1,140 +0,0 @@ -PATH - remote: ../.. - specs: - query_diet (0.7.2) - -GEM - remote: https://rubygems.org/ - specs: - actionmailer (3.2.22.1) - actionpack (= 3.2.22.1) - mail (~> 2.5.4) - actionpack (3.2.22.1) - activemodel (= 3.2.22.1) - activesupport (= 3.2.22.1) - builder (~> 3.0.0) - erubis (~> 2.7.0) - journey (~> 1.0.4) - rack (~> 1.4.5) - rack-cache (~> 1.2) - rack-test (~> 0.6.1) - sprockets (~> 2.2.1) - activemodel (3.2.22.1) - activesupport (= 3.2.22.1) - builder (~> 3.0.0) - activerecord (3.2.22.1) - activemodel (= 3.2.22.1) - activesupport (= 3.2.22.1) - arel (~> 3.0.2) - tzinfo (~> 0.3.29) - activeresource (3.2.22.1) - activemodel (= 3.2.22.1) - activesupport (= 3.2.22.1) - activesupport (3.2.22.1) - i18n (~> 0.6, >= 0.6.4) - multi_json (~> 1.0) - addressable (2.4.0) - arel (3.0.3) - builder (3.0.4) - capybara (2.6.2) - addressable - mime-types (>= 1.16) - nokogiri (>= 1.3.3) - rack (>= 1.0.0) - rack-test (>= 0.5.4) - xpath (~> 2.0) - database_cleaner (1.5.1) - diff-lcs (1.2.5) - erubis (2.7.0) - hike (1.2.3) - i18n (0.7.0) - journey (1.0.4) - json (1.8.6) - mail (2.5.4) - mime-types (~> 1.16) - treetop (~> 1.4.8) - mime-types (1.25.1) - mini_portile2 (2.0.0) - minitest (4.7.5) - multi_json (1.11.2) - nokogiri (1.6.7.2) - mini_portile2 (~> 2.0.0.rc2) - polyglot (0.3.5) - rack (1.4.7) - rack-cache (1.6.1) - rack (>= 0.4) - rack-ssl (1.3.4) - rack - rack-test (0.6.3) - rack (>= 1.0) - rails (3.2.22.1) - actionmailer (= 3.2.22.1) - actionpack (= 3.2.22.1) - activerecord (= 3.2.22.1) - activeresource (= 3.2.22.1) - activesupport (= 3.2.22.1) - bundler (~> 1.0) - railties (= 3.2.22.1) - railties (3.2.22.1) - actionpack (= 3.2.22.1) - activesupport (= 3.2.22.1) - rack-ssl (~> 1.3.2) - rake (>= 0.8.7) - rdoc (~> 3.4) - thor (>= 0.14.6, < 2.0) - rake (10.5.0) - rdoc (3.12.2) - json (~> 1.4) - rspec (3.5.0.beta1) - rspec-core (= 3.5.0.beta1) - rspec-expectations (= 3.5.0.beta1) - rspec-mocks (= 3.5.0.beta1) - rspec-core (3.5.0.beta1) - rspec-support (= 3.5.0.beta1) - rspec-expectations (3.5.0.beta1) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (= 3.5.0.beta1) - rspec-mocks (3.5.0.beta1) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (= 3.5.0.beta1) - rspec-rails (3.5.0.beta1) - actionpack (>= 3.0) - activesupport (>= 3.0) - railties (>= 3.0) - rspec-core (= 3.5.0.beta1) - rspec-expectations (= 3.5.0.beta1) - rspec-mocks (= 3.5.0.beta1) - rspec-support (= 3.5.0.beta1) - rspec-support (3.5.0.beta1) - sprockets (2.2.3) - hike (~> 1.2) - multi_json (~> 1.0) - rack (~> 1.0) - tilt (~> 1.1, != 1.3.0) - sqlite3 (1.3.11) - test-unit-minitest (0.9.1) - minitest (~> 4.7) - thor (0.19.1) - tilt (1.4.1) - treetop (1.4.15) - polyglot - polyglot (>= 0.3.1) - tzinfo (0.3.46) - xpath (2.0.0) - nokogiri (~> 1.3) - -PLATFORMS - ruby - -DEPENDENCIES - capybara - database_cleaner - query_diet! - rails (~> 3.2) - rspec (= 3.5.0.beta1) - rspec-rails (= 3.5.0.beta1) - sqlite3 - test-unit-minitest - -BUNDLED WITH - 1.17.3 diff --git a/spec/rails-3.2/Rakefile b/spec/rails-3.2/Rakefile deleted file mode 100644 index ec0cd09..0000000 --- a/spec/rails-3.2/Rakefile +++ /dev/null @@ -1,10 +0,0 @@ -require 'bundler/setup' -require 'rspec/core/rake_task' - -desc 'Default: Run all specs for a specific rails version.' -task :default => :spec - -desc "Run all specs for a specific rails version" -RSpec::Core::RakeTask.new(:spec) do |t| - t.pattern = defined?(SPEC) ? SPEC : ['../shared/spec/**/*_spec.rb'] -end diff --git a/spec/rails-3.2/app b/spec/rails-3.2/app deleted file mode 120000 index abbdfa6..0000000 --- a/spec/rails-3.2/app +++ /dev/null @@ -1 +0,0 @@ -../shared/app \ No newline at end of file diff --git a/spec/rails-3.2/config/application.rb b/spec/rails-3.2/config/application.rb deleted file mode 100644 index 2e7163a..0000000 --- a/spec/rails-3.2/config/application.rb +++ /dev/null @@ -1,32 +0,0 @@ -require File.expand_path('../boot', __FILE__) - -require 'rails/all' - -# If you have a Gemfile, require the gems listed there, including any gems -# you've limited to :test, :development, or :production. -Bundler.require(:default, Rails.env) if defined?(Bundler) - - -module QueryDietSpecApp - class Application < Rails::Application - config.encoding = "utf-8" - - config.cache_classes = true - config.whiny_nils = true - - config.consider_all_requests_local = true - config.action_controller.perform_caching = false - - config.action_dispatch.show_exceptions = false - - config.action_controller.allow_forgery_protection = false - - config.action_mailer.delivery_method = :test - - config.active_support.deprecation = :stderr - - config.root = File.expand_path('../..', __FILE__) - - # railties.plugins << Rails::Plugin.new(File.expand_path('../../../../..', __FILE__)) - end -end diff --git a/spec/rails-3.2/config/boot.rb b/spec/rails-3.2/config/boot.rb deleted file mode 100644 index ab6cb37..0000000 --- a/spec/rails-3.2/config/boot.rb +++ /dev/null @@ -1,13 +0,0 @@ -require 'rubygems' - -# Set up gems listed in the Gemfile. -gemfile = File.expand_path('../../Gemfile', __FILE__) -begin - ENV['BUNDLE_GEMFILE'] = gemfile - require 'bundler' - Bundler.setup -rescue Bundler::GemNotFound => e - STDERR.puts e.message - STDERR.puts "Try running `bundle install`." - exit! -end if File.exist?(gemfile) diff --git a/spec/rails-3.2/config/database.yml b/spec/rails-3.2/config/database.yml deleted file mode 100644 index 4057667..0000000 --- a/spec/rails-3.2/config/database.yml +++ /dev/null @@ -1,4 +0,0 @@ -test: - adapter: sqlite3 - database: db/query_diet_test.db - verbosity: quiet diff --git a/spec/rails-3.2/config/environment.rb b/spec/rails-3.2/config/environment.rb deleted file mode 100644 index 3a61311..0000000 --- a/spec/rails-3.2/config/environment.rb +++ /dev/null @@ -1,5 +0,0 @@ -# Load the rails application -require File.expand_path('../application', __FILE__) - -# Initialize the rails application -QueryDietSpecApp::Application.initialize! diff --git a/spec/rails-3.2/config/environments/test.rb b/spec/rails-3.2/config/environments/test.rb deleted file mode 100644 index 9347e2c..0000000 --- a/spec/rails-3.2/config/environments/test.rb +++ /dev/null @@ -1,35 +0,0 @@ -QueryDietSpecApp::Application.configure do - # Settings specified here will take precedence over those in config/application.rb - - # The test environment is used exclusively to run your application's - # test suite. You never need to work with it otherwise. Remember that - # your test database is "scratch space" for the test suite and is wiped - # and recreated between test runs. Don't rely on the data there! - config.cache_classes = true - - # Log error messages when you accidentally call methods on nil. - config.whiny_nils = true - - # Show full error reports and disable caching - config.consider_all_requests_local = true - config.action_controller.perform_caching = false - - # Raise exceptions instead of rendering exception templates - config.action_dispatch.show_exceptions = false - - # Disable request forgery protection in test environment - config.action_controller.allow_forgery_protection = false - - # Tell Action Mailer not to deliver emails to the real world. - # The :test delivery method accumulates sent emails in the - # ActionMailer::Base.deliveries array. - config.action_mailer.delivery_method = :test - - # Use SQL instead of Active Record's schema dumper when creating the test database. - # This is necessary if your schema can't be completely dumped by the schema dumper, - # like if you have constraints or database-specific column types - # config.active_record.schema_format = :sql - - # Print deprecation notices to the stderr - config.active_support.deprecation = :stderr -end diff --git a/spec/rails-3.2/config/initializers/backtrace_silencers.rb b/spec/rails-3.2/config/initializers/backtrace_silencers.rb deleted file mode 100644 index 59385cd..0000000 --- a/spec/rails-3.2/config/initializers/backtrace_silencers.rb +++ /dev/null @@ -1,7 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. -# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } - -# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. -# Rails.backtrace_cleaner.remove_silencers! diff --git a/spec/rails-3.2/config/initializers/inflections.rb b/spec/rails-3.2/config/initializers/inflections.rb deleted file mode 100644 index 9e8b013..0000000 --- a/spec/rails-3.2/config/initializers/inflections.rb +++ /dev/null @@ -1,10 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Add new inflection rules using the following format -# (all these examples are active by default): -# ActiveSupport::Inflector.inflections do |inflect| -# inflect.plural /^(ox)$/i, '\1en' -# inflect.singular /^(ox)en/i, '\1' -# inflect.irregular 'person', 'people' -# inflect.uncountable %w( fish sheep ) -# end diff --git a/spec/rails-3.2/config/initializers/mime_types.rb b/spec/rails-3.2/config/initializers/mime_types.rb deleted file mode 100644 index 72aca7e..0000000 --- a/spec/rails-3.2/config/initializers/mime_types.rb +++ /dev/null @@ -1,5 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Add new mime types for use in respond_to blocks: -# Mime::Type.register "text/richtext", :rtf -# Mime::Type.register_alias "text/html", :iphone diff --git a/spec/rails-3.2/config/initializers/secret_token.rb b/spec/rails-3.2/config/initializers/secret_token.rb deleted file mode 100644 index 67bdc43..0000000 --- a/spec/rails-3.2/config/initializers/secret_token.rb +++ /dev/null @@ -1,7 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Your secret key for verifying the integrity of signed cookies. -# If you change this key, all old signed cookies will become invalid! -# Make sure the secret is at least 30 characters and all random, -# no regular words or you'll be exposed to dictionary attacks. -QueryDietSpecApp::Application.config.secret_token = 'cb014a08a45243e7143f31e04774c342c1fba329fd594ae1a480d8283b1a851f425dc08044311fb4be6d000b6e6681de7c76d19148419a5ffa0a9f84556d3b33' diff --git a/spec/rails-3.2/config/initializers/session_store.rb b/spec/rails-3.2/config/initializers/session_store.rb deleted file mode 100644 index 7b60489..0000000 --- a/spec/rails-3.2/config/initializers/session_store.rb +++ /dev/null @@ -1,8 +0,0 @@ -# Be sure to restart your server when you modify this file. - -QueryDietSpecApp::Application.config.session_store :cookie_store, :key => '_app_root_session' - -# Use the database for sessions instead of the cookie-based default, -# which shouldn't be used to store highly confidential information -# (create the session table with "rails generate session_migration") -# QueryDietSpecApp::Application.config.session_store :active_record_store diff --git a/spec/rails-3.2/config/routes.rb b/spec/rails-3.2/config/routes.rb deleted file mode 100644 index ee0f19b..0000000 --- a/spec/rails-3.2/config/routes.rb +++ /dev/null @@ -1,58 +0,0 @@ -QueryDietSpecApp::Application.routes.draw do - # The priority is based upon order of creation: - # first created -> highest priority. - - # Sample of regular route: - # match 'products/:id' => 'catalog#view' - # Keep in mind you can assign values other than :controller and :action - - # Sample of named route: - # match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase - # This route can be invoked with purchase_url(:id => product.id) - - # Sample resource route (maps HTTP verbs to controller actions automatically): - # resources :products - - # Sample resource route with options: - # resources :products do - # member do - # get 'short' - # post 'toggle' - # end - # - # collection do - # get 'sold' - # end - # end - - # Sample resource route with sub-resources: - # resources :products do - # resources :comments, :sales - # resource :seller - # end - - # Sample resource route with more complex sub-resources - # resources :products do - # resources :comments - # resources :sales do - # get 'recent', :on => :collection - # end - # end - - # Sample resource route within a namespace: - # namespace :admin do - # # Directs /admin/products/* to Admin::ProductsController - # # (app/controllers/admin/products_controller.rb) - # resources :products - # end - - # You can have the root of your site routed with "root" - # just remember to delete public/index.html. - # root :to => "welcome#index" - - # See how all your routes lay out with "rake routes" - - # This is a legacy wild controller route that's not recommended for RESTful applications. - # Note: This route will make all actions in every controller accessible via GET requests. - match ':controller(/:action(/:id(.:format)))' -end diff --git a/spec/rails-3.2/db b/spec/rails-3.2/db deleted file mode 120000 index a21da8a..0000000 --- a/spec/rails-3.2/db +++ /dev/null @@ -1 +0,0 @@ -../shared/db \ No newline at end of file diff --git a/spec/rails-3.2/rcov.opts b/spec/rails-3.2/rcov.opts deleted file mode 100644 index 274ed51..0000000 --- a/spec/rails-3.2/rcov.opts +++ /dev/null @@ -1,2 +0,0 @@ ---exclude "spec/*,gems/*" ---rails \ No newline at end of file diff --git a/spec/rails-3.2/spec/spec_helper.rb b/spec/rails-3.2/spec/spec_helper.rb deleted file mode 100644 index 3cff347..0000000 --- a/spec/rails-3.2/spec/spec_helper.rb +++ /dev/null @@ -1,36 +0,0 @@ -$: << File.join(File.dirname(__FILE__), "/../lib" ) - -# Set the default environment to sqlite3's in_memory database -ENV['RAILS_ENV'] ||= 'test' - -# Load the Rails environment and testing framework -require "#{File.dirname(__FILE__)}/../config/environment" -require 'rspec/rails' -require 'database_cleaner' - -FileUtils.rm(Dir.glob("#{Rails.root}/db/*.db"), :force => true) - -# Run the migrations -ActiveRecord::Schema.verbose = false -ActiveRecord::Migrator.migrate("#{Rails.root}/db/migrate") - -# For some reason the first time the SqliteAdapter fetches schema information it -# raises an error -Movie.create rescue nil - -# Movie.reset_column_information - -RSpec.configure do |config| - config.use_transactional_fixtures = false - config.use_instantiated_fixtures = false - config.raise_errors_for_deprecations! - config.infer_spec_type_from_file_location! - config.before { DatabaseCleaner.clean } - config.expect_with(:rspec) { |c| c.syntax = :should } - config.mock_with(:rspec) { |c| c.syntax = :should } -end - -# stop duplicate test runner output, autorun is triggered by rails -if RUBY_VERSION > "2.2.0" - Test::Unit::Runner.class_variable_set(:@@stop_auto_run, true) -end diff --git a/spec/rails-4.2/.gitignore b/spec/rails-4.2/.gitignore deleted file mode 100644 index af64fae..0000000 --- a/spec/rails-4.2/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -.bundle -db/*.sqlite3 -log/*.log -tmp/**/* diff --git a/spec/rails-4.2/.rspec b/spec/rails-4.2/.rspec deleted file mode 100644 index 89da67b..0000000 --- a/spec/rails-4.2/.rspec +++ /dev/null @@ -1,2 +0,0 @@ ---colour ---format progress diff --git a/spec/rails-4.2/Gemfile b/spec/rails-4.2/Gemfile deleted file mode 100644 index 2ad95f2..0000000 --- a/spec/rails-4.2/Gemfile +++ /dev/null @@ -1,9 +0,0 @@ -source 'https://rubygems.org' - -gem 'sqlite3', '~>1.3.6' -gem 'rails', '=4.2.11.3' -gem 'rspec' -gem 'rspec-rails' -gem 'database_cleaner' -gem 'query_diet', :path => '../..' -gem 'capybara' diff --git a/spec/rails-4.2/Gemfile.lock b/spec/rails-4.2/Gemfile.lock deleted file mode 100644 index f663c25..0000000 --- a/spec/rails-4.2/Gemfile.lock +++ /dev/null @@ -1,153 +0,0 @@ -PATH - remote: ../.. - specs: - query_diet (0.7.2) - -GEM - remote: https://rubygems.org/ - specs: - actionmailer (4.2.11.3) - actionpack (= 4.2.11.3) - actionview (= 4.2.11.3) - activejob (= 4.2.11.3) - mail (~> 2.5, >= 2.5.4) - rails-dom-testing (~> 1.0, >= 1.0.5) - actionpack (4.2.11.3) - actionview (= 4.2.11.3) - activesupport (= 4.2.11.3) - rack (~> 1.6) - rack-test (~> 0.6.2) - rails-dom-testing (~> 1.0, >= 1.0.5) - rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (4.2.11.3) - activesupport (= 4.2.11.3) - builder (~> 3.1) - erubis (~> 2.7.0) - rails-dom-testing (~> 1.0, >= 1.0.5) - rails-html-sanitizer (~> 1.0, >= 1.0.3) - activejob (4.2.11.3) - activesupport (= 4.2.11.3) - globalid (>= 0.3.0) - activemodel (4.2.11.3) - activesupport (= 4.2.11.3) - builder (~> 3.1) - activerecord (4.2.11.3) - activemodel (= 4.2.11.3) - activesupport (= 4.2.11.3) - arel (~> 6.0) - activesupport (4.2.11.3) - i18n (~> 0.7) - minitest (~> 5.1) - thread_safe (~> 0.3, >= 0.3.4) - tzinfo (~> 1.1) - addressable (2.7.0) - public_suffix (>= 2.0.2, < 5.0) - arel (6.0.4) - builder (3.2.4) - capybara (3.34.0) - addressable - mini_mime (>= 0.1.3) - nokogiri (~> 1.8) - rack (>= 1.6.0) - rack-test (>= 0.6.3) - regexp_parser (~> 1.5) - xpath (~> 3.2) - concurrent-ruby (1.1.7) - crass (1.0.6) - database_cleaner (1.8.5) - diff-lcs (1.4.4) - erubis (2.7.0) - globalid (0.4.2) - activesupport (>= 4.2.0) - i18n (0.9.5) - concurrent-ruby (~> 1.0) - loofah (2.8.0) - crass (~> 1.0.2) - nokogiri (>= 1.5.9) - mail (2.7.1) - mini_mime (>= 0.1.1) - mini_mime (1.0.2) - mini_portile2 (2.4.0) - minitest (5.14.2) - nokogiri (1.10.10) - mini_portile2 (~> 2.4.0) - public_suffix (4.0.6) - rack (1.6.13) - rack-test (0.6.3) - rack (>= 1.0) - rails (4.2.11.3) - actionmailer (= 4.2.11.3) - actionpack (= 4.2.11.3) - actionview (= 4.2.11.3) - activejob (= 4.2.11.3) - activemodel (= 4.2.11.3) - activerecord (= 4.2.11.3) - activesupport (= 4.2.11.3) - bundler (>= 1.3.0, < 2.0) - railties (= 4.2.11.3) - sprockets-rails - rails-deprecated_sanitizer (1.0.3) - activesupport (>= 4.2.0.alpha) - rails-dom-testing (1.0.9) - activesupport (>= 4.2.0, < 5.0) - nokogiri (~> 1.6) - rails-deprecated_sanitizer (>= 1.0.1) - rails-html-sanitizer (1.3.0) - loofah (~> 2.3) - railties (4.2.11.3) - actionpack (= 4.2.11.3) - activesupport (= 4.2.11.3) - rake (>= 0.8.7) - thor (>= 0.18.1, < 2.0) - rake (13.0.1) - regexp_parser (1.8.2) - rspec (3.10.0) - rspec-core (~> 3.10.0) - rspec-expectations (~> 3.10.0) - rspec-mocks (~> 3.10.0) - rspec-core (3.10.0) - rspec-support (~> 3.10.0) - rspec-expectations (3.10.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.10.0) - rspec-mocks (3.10.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.10.0) - rspec-rails (4.0.1) - actionpack (>= 4.2) - activesupport (>= 4.2) - railties (>= 4.2) - rspec-core (~> 3.9) - rspec-expectations (~> 3.9) - rspec-mocks (~> 3.9) - rspec-support (~> 3.9) - rspec-support (3.10.0) - sprockets (4.0.2) - concurrent-ruby (~> 1.0) - rack (> 1, < 3) - sprockets-rails (3.2.2) - actionpack (>= 4.0) - activesupport (>= 4.0) - sprockets (>= 3.0.0) - sqlite3 (1.3.13) - thor (1.0.1) - thread_safe (0.3.6) - tzinfo (1.2.8) - thread_safe (~> 0.1) - xpath (3.2.0) - nokogiri (~> 1.8) - -PLATFORMS - ruby - -DEPENDENCIES - capybara - database_cleaner - query_diet! - rails (= 4.2.11.3) - rspec - rspec-rails - sqlite3 (~> 1.3.6) - -BUNDLED WITH - 1.17.3 diff --git a/spec/rails-4.2/Rakefile b/spec/rails-4.2/Rakefile deleted file mode 100644 index 9f60eef..0000000 --- a/spec/rails-4.2/Rakefile +++ /dev/null @@ -1,10 +0,0 @@ -require 'rake' -require 'rspec/core/rake_task' - -desc 'Default: Run all specs for a specific rails version.' -task :default => :spec - -desc "Run all specs for a specific rails version" -RSpec::Core::RakeTask.new(:spec) do |t| - t.pattern = defined?(SPEC) ? SPEC : ['../shared/spec/**/*_spec.rb'] -end diff --git a/spec/rails-4.2/app b/spec/rails-4.2/app deleted file mode 120000 index abbdfa6..0000000 --- a/spec/rails-4.2/app +++ /dev/null @@ -1 +0,0 @@ -../shared/app \ No newline at end of file diff --git a/spec/rails-4.2/config/application.rb b/spec/rails-4.2/config/application.rb deleted file mode 100644 index a87a16d..0000000 --- a/spec/rails-4.2/config/application.rb +++ /dev/null @@ -1,39 +0,0 @@ -require File.expand_path('../boot', __FILE__) - -require 'active_model/railtie' -require 'active_job/railtie' -require 'active_record/railtie' -require 'action_controller/railtie' -require 'action_mailer/railtie' -require 'action_view/railtie' -# require 'sprockets/railtie' -require 'rails/test_unit/railtie' - -# If you have a Gemfile, require the gems listed there, including any gems -# you've limited to :test, :development, or :production. -Bundler.require(:default, Rails.env) if defined?(Bundler) - - -module QueryDietSpecApp - class Application < Rails::Application - config.encoding = "utf-8" - - config.cache_classes = true - config.whiny_nils = true - - config.consider_all_requests_local = true - config.action_controller.perform_caching = false - - config.action_dispatch.show_exceptions = false - - config.action_controller.allow_forgery_protection = false - - config.action_mailer.delivery_method = :test - - config.active_support.deprecation = :stderr - - config.root = File.expand_path('../..', __FILE__) - - # railties.plugins << Rails::Plugin.new(File.expand_path('../../../../..', __FILE__)) - end -end diff --git a/spec/rails-4.2/config/boot.rb b/spec/rails-4.2/config/boot.rb deleted file mode 100644 index ab6cb37..0000000 --- a/spec/rails-4.2/config/boot.rb +++ /dev/null @@ -1,13 +0,0 @@ -require 'rubygems' - -# Set up gems listed in the Gemfile. -gemfile = File.expand_path('../../Gemfile', __FILE__) -begin - ENV['BUNDLE_GEMFILE'] = gemfile - require 'bundler' - Bundler.setup -rescue Bundler::GemNotFound => e - STDERR.puts e.message - STDERR.puts "Try running `bundle install`." - exit! -end if File.exist?(gemfile) diff --git a/spec/rails-4.2/config/database.yml b/spec/rails-4.2/config/database.yml deleted file mode 100644 index 4057667..0000000 --- a/spec/rails-4.2/config/database.yml +++ /dev/null @@ -1,4 +0,0 @@ -test: - adapter: sqlite3 - database: db/query_diet_test.db - verbosity: quiet diff --git a/spec/rails-4.2/config/environment.rb b/spec/rails-4.2/config/environment.rb deleted file mode 100644 index 3a61311..0000000 --- a/spec/rails-4.2/config/environment.rb +++ /dev/null @@ -1,5 +0,0 @@ -# Load the rails application -require File.expand_path('../application', __FILE__) - -# Initialize the rails application -QueryDietSpecApp::Application.initialize! diff --git a/spec/rails-4.2/config/environments/test.rb b/spec/rails-4.2/config/environments/test.rb deleted file mode 100644 index d821b64..0000000 --- a/spec/rails-4.2/config/environments/test.rb +++ /dev/null @@ -1,37 +0,0 @@ -QueryDietSpecApp::Application.configure do - # Settings specified here will take precedence over those in config/application.rb - - # The test environment is used exclusively to run your application's - # test suite. You never need to work with it otherwise. Remember that - # your test database is "scratch space" for the test suite and is wiped - # and recreated between test runs. Don't rely on the data there! - config.cache_classes = true - - # Log error messages when you accidentally call methods on nil. - config.whiny_nils = true - - # Show full error reports and disable caching - config.consider_all_requests_local = true - config.action_controller.perform_caching = false - - # Raise exceptions instead of rendering exception templates - config.action_dispatch.show_exceptions = false - - # Disable request forgery protection in test environment - config.action_controller.allow_forgery_protection = false - - # Tell Action Mailer not to deliver emails to the real world. - # The :test delivery method accumulates sent emails in the - # ActionMailer::Base.deliveries array. - config.action_mailer.delivery_method = :test - - # Use SQL instead of Active Record's schema dumper when creating the test database. - # This is necessary if your schema can't be completely dumped by the schema dumper, - # like if you have constraints or database-specific column types - # config.active_record.schema_format = :sql - - # Print deprecation notices to the stderr - config.active_support.deprecation = :stderr - - config.eager_load = false -end diff --git a/spec/rails-4.2/config/initializers/backtrace_silencers.rb b/spec/rails-4.2/config/initializers/backtrace_silencers.rb deleted file mode 100644 index 59385cd..0000000 --- a/spec/rails-4.2/config/initializers/backtrace_silencers.rb +++ /dev/null @@ -1,7 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. -# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } - -# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. -# Rails.backtrace_cleaner.remove_silencers! diff --git a/spec/rails-4.2/config/initializers/inflections.rb b/spec/rails-4.2/config/initializers/inflections.rb deleted file mode 100644 index 9e8b013..0000000 --- a/spec/rails-4.2/config/initializers/inflections.rb +++ /dev/null @@ -1,10 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Add new inflection rules using the following format -# (all these examples are active by default): -# ActiveSupport::Inflector.inflections do |inflect| -# inflect.plural /^(ox)$/i, '\1en' -# inflect.singular /^(ox)en/i, '\1' -# inflect.irregular 'person', 'people' -# inflect.uncountable %w( fish sheep ) -# end diff --git a/spec/rails-4.2/config/initializers/mime_types.rb b/spec/rails-4.2/config/initializers/mime_types.rb deleted file mode 100644 index 72aca7e..0000000 --- a/spec/rails-4.2/config/initializers/mime_types.rb +++ /dev/null @@ -1,5 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Add new mime types for use in respond_to blocks: -# Mime::Type.register "text/richtext", :rtf -# Mime::Type.register_alias "text/html", :iphone diff --git a/spec/rails-4.2/config/initializers/secret_token.rb b/spec/rails-4.2/config/initializers/secret_token.rb deleted file mode 100644 index 67bdc43..0000000 --- a/spec/rails-4.2/config/initializers/secret_token.rb +++ /dev/null @@ -1,7 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Your secret key for verifying the integrity of signed cookies. -# If you change this key, all old signed cookies will become invalid! -# Make sure the secret is at least 30 characters and all random, -# no regular words or you'll be exposed to dictionary attacks. -QueryDietSpecApp::Application.config.secret_token = 'cb014a08a45243e7143f31e04774c342c1fba329fd594ae1a480d8283b1a851f425dc08044311fb4be6d000b6e6681de7c76d19148419a5ffa0a9f84556d3b33' diff --git a/spec/rails-4.2/config/initializers/session_store.rb b/spec/rails-4.2/config/initializers/session_store.rb deleted file mode 100644 index 7b60489..0000000 --- a/spec/rails-4.2/config/initializers/session_store.rb +++ /dev/null @@ -1,8 +0,0 @@ -# Be sure to restart your server when you modify this file. - -QueryDietSpecApp::Application.config.session_store :cookie_store, :key => '_app_root_session' - -# Use the database for sessions instead of the cookie-based default, -# which shouldn't be used to store highly confidential information -# (create the session table with "rails generate session_migration") -# QueryDietSpecApp::Application.config.session_store :active_record_store diff --git a/spec/rails-4.2/config/routes.rb b/spec/rails-4.2/config/routes.rb deleted file mode 100644 index 4f4a598..0000000 --- a/spec/rails-4.2/config/routes.rb +++ /dev/null @@ -1,58 +0,0 @@ -QueryDietSpecApp::Application.routes.draw do - # The priority is based upon order of creation: - # first created -> highest priority. - - # Sample of regular route: - # match 'products/:id' => 'catalog#view' - # Keep in mind you can assign values other than :controller and :action - - # Sample of named route: - # match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase - # This route can be invoked with purchase_url(:id => product.id) - - # Sample resource route (maps HTTP verbs to controller actions automatically): - # resources :products - - # Sample resource route with options: - # resources :products do - # member do - # get 'short' - # post 'toggle' - # end - # - # collection do - # get 'sold' - # end - # end - - # Sample resource route with sub-resources: - # resources :products do - # resources :comments, :sales - # resource :seller - # end - - # Sample resource route with more complex sub-resources - # resources :products do - # resources :comments - # resources :sales do - # get 'recent', :on => :collection - # end - # end - - # Sample resource route within a namespace: - # namespace :admin do - # # Directs /admin/products/* to Admin::ProductsController - # # (app/controllers/admin/products_controller.rb) - # resources :products - # end - - # You can have the root of your site routed with "root" - # just remember to delete public/index.html. - # root :to => "welcome#index" - - # See how all your routes lay out with "rake routes" - - # This is a legacy wild controller route that's not recommended for RESTful applications. - # Note: This route will make all actions in every controller accessible via GET requests. - get ':controller(/:action(/:id(.:format)))' -end diff --git a/spec/rails-4.2/config/secrets.yml b/spec/rails-4.2/config/secrets.yml deleted file mode 100644 index 03e7cd7..0000000 --- a/spec/rails-4.2/config/secrets.yml +++ /dev/null @@ -1,2 +0,0 @@ -test: - secret_key_base: the_secret diff --git a/spec/rails-4.2/db b/spec/rails-4.2/db deleted file mode 120000 index a21da8a..0000000 --- a/spec/rails-4.2/db +++ /dev/null @@ -1 +0,0 @@ -../shared/db \ No newline at end of file diff --git a/spec/rails-4.2/rcov.opts b/spec/rails-4.2/rcov.opts deleted file mode 100644 index 274ed51..0000000 --- a/spec/rails-4.2/rcov.opts +++ /dev/null @@ -1,2 +0,0 @@ ---exclude "spec/*,gems/*" ---rails \ No newline at end of file diff --git a/spec/rails-4.2/spec/spec_helper.rb b/spec/rails-4.2/spec/spec_helper.rb deleted file mode 100644 index 4f5cdbd..0000000 --- a/spec/rails-4.2/spec/spec_helper.rb +++ /dev/null @@ -1,29 +0,0 @@ -$: << File.join(File.dirname(__FILE__), "/../lib" ) - -# Set the default environment to sqlite3's in_memory database -ENV['RAILS_ENV'] ||= 'test' - -# Load the Rails environment and testing framework -require "#{File.dirname(__FILE__)}/../config/environment" -require 'rspec/rails' -require 'database_cleaner' - -FileUtils.rm(Dir.glob("#{Rails.root}/db/*.db"), :force => true) - -# Run the migrations -ActiveRecord::Schema.verbose = false -ActiveRecord::Migrator.migrate("#{Rails.root}/db/migrate") - -# For some reason the first time the SqliteAdapter fetches schema information it -# raises an error -Movie.create rescue nil - -# Movie.reset_column_information - -RSpec.configure do |config| - config.use_transactional_fixtures = false - config.use_instantiated_fixtures = false - config.expect_with(:rspec) { |c| c.syntax = :should } - config.mock_with(:rspec) { |c| c.syntax = :should } - config.before { DatabaseCleaner.clean } -end diff --git a/spec/rails-5.2/.gitignore b/spec/rails-5.2/.gitignore deleted file mode 100644 index af64fae..0000000 --- a/spec/rails-5.2/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -.bundle -db/*.sqlite3 -log/*.log -tmp/**/* diff --git a/spec/rails-5.2/Gemfile b/spec/rails-5.2/Gemfile deleted file mode 100644 index 78144da..0000000 --- a/spec/rails-5.2/Gemfile +++ /dev/null @@ -1,9 +0,0 @@ -source 'https://rubygems.org' - -gem 'sqlite3' -gem 'rails', '=5.2.4.4' -gem 'rspec' -gem 'rspec-rails' -gem 'database_cleaner' -gem 'query_diet', :path => '../..' -gem 'capybara' diff --git a/spec/rails-5.2/Gemfile.lock b/spec/rails-5.2/Gemfile.lock deleted file mode 100644 index 299f21b..0000000 --- a/spec/rails-5.2/Gemfile.lock +++ /dev/null @@ -1,170 +0,0 @@ -PATH - remote: ../.. - specs: - query_diet (0.7.2) - -GEM - remote: https://rubygems.org/ - specs: - actioncable (5.2.4.4) - actionpack (= 5.2.4.4) - nio4r (~> 2.0) - websocket-driver (>= 0.6.1) - actionmailer (5.2.4.4) - actionpack (= 5.2.4.4) - actionview (= 5.2.4.4) - activejob (= 5.2.4.4) - mail (~> 2.5, >= 2.5.4) - rails-dom-testing (~> 2.0) - actionpack (5.2.4.4) - actionview (= 5.2.4.4) - activesupport (= 5.2.4.4) - rack (~> 2.0, >= 2.0.8) - rack-test (>= 0.6.3) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (5.2.4.4) - activesupport (= 5.2.4.4) - builder (~> 3.1) - erubi (~> 1.4) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.0.3) - activejob (5.2.4.4) - activesupport (= 5.2.4.4) - globalid (>= 0.3.6) - activemodel (5.2.4.4) - activesupport (= 5.2.4.4) - activerecord (5.2.4.4) - activemodel (= 5.2.4.4) - activesupport (= 5.2.4.4) - arel (>= 9.0) - activestorage (5.2.4.4) - actionpack (= 5.2.4.4) - activerecord (= 5.2.4.4) - marcel (~> 0.3.1) - activesupport (5.2.4.4) - concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (>= 0.7, < 2) - minitest (~> 5.1) - tzinfo (~> 1.1) - addressable (2.7.0) - public_suffix (>= 2.0.2, < 5.0) - arel (9.0.0) - builder (3.2.4) - capybara (3.34.0) - addressable - mini_mime (>= 0.1.3) - nokogiri (~> 1.8) - rack (>= 1.6.0) - rack-test (>= 0.6.3) - regexp_parser (~> 1.5) - xpath (~> 3.2) - concurrent-ruby (1.1.7) - crass (1.0.6) - database_cleaner (1.8.5) - diff-lcs (1.4.4) - erubi (1.10.0) - globalid (0.4.2) - activesupport (>= 4.2.0) - i18n (1.8.5) - concurrent-ruby (~> 1.0) - loofah (2.8.0) - crass (~> 1.0.2) - nokogiri (>= 1.5.9) - mail (2.7.1) - mini_mime (>= 0.1.1) - marcel (0.3.3) - mimemagic (~> 0.3.2) - method_source (1.0.0) - mimemagic (0.3.10) - nokogiri (~> 1) - rake - mini_mime (1.0.2) - mini_portile2 (2.4.0) - minitest (5.14.2) - nio4r (2.5.4) - nokogiri (1.10.10) - mini_portile2 (~> 2.4.0) - public_suffix (4.0.6) - rack (2.2.3) - rack-test (1.1.0) - rack (>= 1.0, < 3) - rails (5.2.4.4) - actioncable (= 5.2.4.4) - actionmailer (= 5.2.4.4) - actionpack (= 5.2.4.4) - actionview (= 5.2.4.4) - activejob (= 5.2.4.4) - activemodel (= 5.2.4.4) - activerecord (= 5.2.4.4) - activestorage (= 5.2.4.4) - activesupport (= 5.2.4.4) - bundler (>= 1.3.0) - railties (= 5.2.4.4) - sprockets-rails (>= 2.0.0) - rails-dom-testing (2.0.3) - activesupport (>= 4.2.0) - nokogiri (>= 1.6) - rails-html-sanitizer (1.3.0) - loofah (~> 2.3) - railties (5.2.4.4) - actionpack (= 5.2.4.4) - activesupport (= 5.2.4.4) - method_source - rake (>= 0.8.7) - thor (>= 0.19.0, < 2.0) - rake (13.0.1) - regexp_parser (1.8.2) - rspec (3.10.0) - rspec-core (~> 3.10.0) - rspec-expectations (~> 3.10.0) - rspec-mocks (~> 3.10.0) - rspec-core (3.10.0) - rspec-support (~> 3.10.0) - rspec-expectations (3.10.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.10.0) - rspec-mocks (3.10.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.10.0) - rspec-rails (4.0.1) - actionpack (>= 4.2) - activesupport (>= 4.2) - railties (>= 4.2) - rspec-core (~> 3.9) - rspec-expectations (~> 3.9) - rspec-mocks (~> 3.9) - rspec-support (~> 3.9) - rspec-support (3.10.0) - sprockets (4.0.2) - concurrent-ruby (~> 1.0) - rack (> 1, < 3) - sprockets-rails (3.2.2) - actionpack (>= 4.0) - activesupport (>= 4.0) - sprockets (>= 3.0.0) - sqlite3 (1.4.2) - thor (1.0.1) - thread_safe (0.3.6) - tzinfo (1.2.8) - thread_safe (~> 0.1) - websocket-driver (0.7.3) - websocket-extensions (>= 0.1.0) - websocket-extensions (0.1.5) - xpath (3.2.0) - nokogiri (~> 1.8) - -PLATFORMS - ruby - -DEPENDENCIES - capybara - database_cleaner - query_diet! - rails (= 5.2.4.4) - rspec - rspec-rails - sqlite3 - -BUNDLED WITH - 1.17.3 diff --git a/spec/rails-5.2/Rakefile b/spec/rails-5.2/Rakefile deleted file mode 100644 index 9f60eef..0000000 --- a/spec/rails-5.2/Rakefile +++ /dev/null @@ -1,10 +0,0 @@ -require 'rake' -require 'rspec/core/rake_task' - -desc 'Default: Run all specs for a specific rails version.' -task :default => :spec - -desc "Run all specs for a specific rails version" -RSpec::Core::RakeTask.new(:spec) do |t| - t.pattern = defined?(SPEC) ? SPEC : ['../shared/spec/**/*_spec.rb'] -end diff --git a/spec/rails-5.2/app b/spec/rails-5.2/app deleted file mode 120000 index f433e9c..0000000 --- a/spec/rails-5.2/app +++ /dev/null @@ -1 +0,0 @@ -../shared/app/ \ No newline at end of file diff --git a/spec/rails-5.2/config/application.rb b/spec/rails-5.2/config/application.rb deleted file mode 100644 index 2ef35ba..0000000 --- a/spec/rails-5.2/config/application.rb +++ /dev/null @@ -1,41 +0,0 @@ -require File.expand_path('../boot', __FILE__) - -require 'active_model/railtie' -require 'active_job/railtie' -require 'active_record/railtie' -require 'action_controller/railtie' -require 'action_mailer/railtie' -require 'action_view/railtie' -# require 'sprockets/railtie' -require 'rails/test_unit/railtie' - -# If you have a Gemfile, require the gems listed there, including any gems -# you've limited to :test, :development, or :production. -Bundler.require(:default, Rails.env) if defined?(Bundler) - - -module QueryDietSpecApp - class Application < Rails::Application - config.encoding = "utf-8" - - config.cache_classes = true - config.whiny_nils = true - - config.consider_all_requests_local = true - config.action_controller.perform_caching = false - - config.action_dispatch.show_exceptions = false - - config.action_controller.allow_forgery_protection = false - - config.action_mailer.delivery_method = :test - - config.active_support.deprecation = :stderr - - config.active_record.sqlite3.represent_boolean_as_integer = true - - config.root = File.expand_path('../..', __FILE__) - - # railties.plugins << Rails::Plugin.new(File.expand_path('../../../../..', __FILE__)) - end -end diff --git a/spec/rails-5.2/config/boot.rb b/spec/rails-5.2/config/boot.rb deleted file mode 100644 index ab6cb37..0000000 --- a/spec/rails-5.2/config/boot.rb +++ /dev/null @@ -1,13 +0,0 @@ -require 'rubygems' - -# Set up gems listed in the Gemfile. -gemfile = File.expand_path('../../Gemfile', __FILE__) -begin - ENV['BUNDLE_GEMFILE'] = gemfile - require 'bundler' - Bundler.setup -rescue Bundler::GemNotFound => e - STDERR.puts e.message - STDERR.puts "Try running `bundle install`." - exit! -end if File.exist?(gemfile) diff --git a/spec/rails-5.2/config/database.yml b/spec/rails-5.2/config/database.yml deleted file mode 100644 index 4057667..0000000 --- a/spec/rails-5.2/config/database.yml +++ /dev/null @@ -1,4 +0,0 @@ -test: - adapter: sqlite3 - database: db/query_diet_test.db - verbosity: quiet diff --git a/spec/rails-5.2/config/environment.rb b/spec/rails-5.2/config/environment.rb deleted file mode 100644 index 3a61311..0000000 --- a/spec/rails-5.2/config/environment.rb +++ /dev/null @@ -1,5 +0,0 @@ -# Load the rails application -require File.expand_path('../application', __FILE__) - -# Initialize the rails application -QueryDietSpecApp::Application.initialize! diff --git a/spec/rails-5.2/config/environments/test.rb b/spec/rails-5.2/config/environments/test.rb deleted file mode 100644 index d821b64..0000000 --- a/spec/rails-5.2/config/environments/test.rb +++ /dev/null @@ -1,37 +0,0 @@ -QueryDietSpecApp::Application.configure do - # Settings specified here will take precedence over those in config/application.rb - - # The test environment is used exclusively to run your application's - # test suite. You never need to work with it otherwise. Remember that - # your test database is "scratch space" for the test suite and is wiped - # and recreated between test runs. Don't rely on the data there! - config.cache_classes = true - - # Log error messages when you accidentally call methods on nil. - config.whiny_nils = true - - # Show full error reports and disable caching - config.consider_all_requests_local = true - config.action_controller.perform_caching = false - - # Raise exceptions instead of rendering exception templates - config.action_dispatch.show_exceptions = false - - # Disable request forgery protection in test environment - config.action_controller.allow_forgery_protection = false - - # Tell Action Mailer not to deliver emails to the real world. - # The :test delivery method accumulates sent emails in the - # ActionMailer::Base.deliveries array. - config.action_mailer.delivery_method = :test - - # Use SQL instead of Active Record's schema dumper when creating the test database. - # This is necessary if your schema can't be completely dumped by the schema dumper, - # like if you have constraints or database-specific column types - # config.active_record.schema_format = :sql - - # Print deprecation notices to the stderr - config.active_support.deprecation = :stderr - - config.eager_load = false -end diff --git a/spec/rails-5.2/config/initializers/backtrace_silencers.rb b/spec/rails-5.2/config/initializers/backtrace_silencers.rb deleted file mode 100644 index 59385cd..0000000 --- a/spec/rails-5.2/config/initializers/backtrace_silencers.rb +++ /dev/null @@ -1,7 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. -# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } - -# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. -# Rails.backtrace_cleaner.remove_silencers! diff --git a/spec/rails-5.2/config/initializers/inflections.rb b/spec/rails-5.2/config/initializers/inflections.rb deleted file mode 100644 index 9e8b013..0000000 --- a/spec/rails-5.2/config/initializers/inflections.rb +++ /dev/null @@ -1,10 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Add new inflection rules using the following format -# (all these examples are active by default): -# ActiveSupport::Inflector.inflections do |inflect| -# inflect.plural /^(ox)$/i, '\1en' -# inflect.singular /^(ox)en/i, '\1' -# inflect.irregular 'person', 'people' -# inflect.uncountable %w( fish sheep ) -# end diff --git a/spec/rails-5.2/config/initializers/mime_types.rb b/spec/rails-5.2/config/initializers/mime_types.rb deleted file mode 100644 index 72aca7e..0000000 --- a/spec/rails-5.2/config/initializers/mime_types.rb +++ /dev/null @@ -1,5 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Add new mime types for use in respond_to blocks: -# Mime::Type.register "text/richtext", :rtf -# Mime::Type.register_alias "text/html", :iphone diff --git a/spec/rails-5.2/config/initializers/session_store.rb b/spec/rails-5.2/config/initializers/session_store.rb deleted file mode 100644 index 7b60489..0000000 --- a/spec/rails-5.2/config/initializers/session_store.rb +++ /dev/null @@ -1,8 +0,0 @@ -# Be sure to restart your server when you modify this file. - -QueryDietSpecApp::Application.config.session_store :cookie_store, :key => '_app_root_session' - -# Use the database for sessions instead of the cookie-based default, -# which shouldn't be used to store highly confidential information -# (create the session table with "rails generate session_migration") -# QueryDietSpecApp::Application.config.session_store :active_record_store diff --git a/spec/rails-5.2/config/routes.rb b/spec/rails-5.2/config/routes.rb deleted file mode 100644 index 01d01a5..0000000 --- a/spec/rails-5.2/config/routes.rb +++ /dev/null @@ -1,59 +0,0 @@ -QueryDietSpecApp::Application.routes.draw do - # The priority is based upon order of creation: - # first created -> highest priority. - - # Sample of regular route: - # match 'products/:id' => 'catalog#view' - # Keep in mind you can assign values other than :controller and :action - - # Sample of named route: - # match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase - # This route can be invoked with purchase_url(:id => product.id) - - # Sample resource route (maps HTTP verbs to controller actions automatically): - # resources :products - - # Sample resource route with options: - # resources :products do - # member do - # get 'short' - # post 'toggle' - # end - # - # collection do - # get 'sold' - # end - # end - - # Sample resource route with sub-resources: - # resources :products do - # resources :comments, :sales - # resource :seller - # end - - # Sample resource route with more complex sub-resources - # resources :products do - # resources :comments - # resources :sales do - # get 'recent', :on => :collection - # end - # end - - # Sample resource route within a namespace: - # namespace :admin do - # # Directs /admin/products/* to Admin::ProductsController - # # (app/controllers/admin/products_controller.rb) - # resources :products - # end - - # You can have the root of your site routed with "root" - # just remember to delete public/index.html. - # root :to => "welcome#index" - - # See how all your routes lay out with "rake routes" - - # This is a legacy wild controller route that's not recommended for RESTful applications. - # Note: This route will make all actions in every controller accessible via GET requests. - get '/query_diet/no_query', to: 'query_diet#no_query' - get '/query_diet/two_queries', to: 'query_diet#two_queries' -end diff --git a/spec/rails-5.2/config/secrets.yml b/spec/rails-5.2/config/secrets.yml deleted file mode 100644 index 03e7cd7..0000000 --- a/spec/rails-5.2/config/secrets.yml +++ /dev/null @@ -1,2 +0,0 @@ -test: - secret_key_base: the_secret diff --git a/spec/rails-5.2/db b/spec/rails-5.2/db deleted file mode 120000 index 053d3db..0000000 --- a/spec/rails-5.2/db +++ /dev/null @@ -1 +0,0 @@ -../shared/db/ \ No newline at end of file diff --git a/spec/rails-5.2/rcov.opts b/spec/rails-5.2/rcov.opts deleted file mode 100644 index 274ed51..0000000 --- a/spec/rails-5.2/rcov.opts +++ /dev/null @@ -1,2 +0,0 @@ ---exclude "spec/*,gems/*" ---rails \ No newline at end of file diff --git a/spec/rails-5.2/spec/spec_helper.rb b/spec/rails-5.2/spec/spec_helper.rb deleted file mode 100644 index f0297d5..0000000 --- a/spec/rails-5.2/spec/spec_helper.rb +++ /dev/null @@ -1,29 +0,0 @@ -$: << File.join(File.dirname(__FILE__), "/../lib" ) - -# Set the default environment to sqlite3's in_memory database -ENV['RAILS_ENV'] ||= 'test' - -# Load the Rails environment and testing framework -require "#{File.dirname(__FILE__)}/../config/environment" -require 'rspec/rails' -require 'database_cleaner' - -FileUtils.rm(Dir.glob("#{Rails.root}/db/*.db"), :force => true) - -# Run the migrations -ActiveRecord::Schema.verbose = false -ActiveRecord::MigrationContext.new("#{Rails.root}/db/migrate").migrate - -# For some reason the first time the SqliteAdapter fetches schema information it -# raises an error -Movie.create rescue nil - -# Movie.reset_column_information - -RSpec.configure do |config| - config.use_transactional_fixtures = false - config.use_instantiated_fixtures = false - config.expect_with(:rspec) { |c| c.syntax = :should } - config.mock_with(:rspec) { |c| c.syntax = :should } - config.before { DatabaseCleaner.clean } -end diff --git a/spec/rails-6.1/.gitignore b/spec/rails-6.1/.gitignore deleted file mode 100644 index af64fae..0000000 --- a/spec/rails-6.1/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -.bundle -db/*.sqlite3 -log/*.log -tmp/**/* diff --git a/spec/rails-6.1/Rakefile b/spec/rails-6.1/Rakefile deleted file mode 100644 index 9f60eef..0000000 --- a/spec/rails-6.1/Rakefile +++ /dev/null @@ -1,10 +0,0 @@ -require 'rake' -require 'rspec/core/rake_task' - -desc 'Default: Run all specs for a specific rails version.' -task :default => :spec - -desc "Run all specs for a specific rails version" -RSpec::Core::RakeTask.new(:spec) do |t| - t.pattern = defined?(SPEC) ? SPEC : ['../shared/spec/**/*_spec.rb'] -end diff --git a/spec/rails-6.1/app b/spec/rails-6.1/app deleted file mode 120000 index abbdfa6..0000000 --- a/spec/rails-6.1/app +++ /dev/null @@ -1 +0,0 @@ -../shared/app \ No newline at end of file diff --git a/spec/rails-6.1/config/application.rb b/spec/rails-6.1/config/application.rb deleted file mode 100644 index 3e4ca93..0000000 --- a/spec/rails-6.1/config/application.rb +++ /dev/null @@ -1,50 +0,0 @@ -require File.expand_path('../boot', __FILE__) - -require 'rails' -# Pick the frameworks you want: -require 'active_model/railtie' -require 'active_job/railtie' -require 'active_record/railtie' -# require 'active_storage/engine' -require 'action_controller/railtie' -require 'action_mailer/railtie' -# require 'action_mailbox/engine' -# require 'action_text/engine' -require 'action_view/railtie' -# require 'action_cable/engine' -# require 'sprockets/railtie' -require 'rails/test_unit/railtie' - -# If you have a Gemfile, require the gems listed there, including any gems -# you've limited to :test, :development, or :production. -Bundler.require(:default, Rails.env) if defined?(Bundler) - - -module QueryDietSpecApp - class Application < Rails::Application - # Initialize configuration defaults for originally generated Rails version. - config.load_defaults 6.1 - - config.encoding = "utf-8" - - config.cache_classes = true - config.whiny_nils = true - - config.consider_all_requests_local = true - config.action_controller.perform_caching = false - - config.action_dispatch.show_exceptions = false - - config.action_controller.allow_forgery_protection = false - - config.action_mailer.delivery_method = :test - - config.active_support.deprecation = :stderr - - # config.active_record.sqlite3.represent_boolean_as_integer = true - - config.root = File.expand_path('../..', __FILE__) - - # railties.plugins << Rails::Plugin.new(File.expand_path('../../../../..', __FILE__)) - end -end diff --git a/spec/rails-6.1/config/boot.rb b/spec/rails-6.1/config/boot.rb deleted file mode 100644 index ab6cb37..0000000 --- a/spec/rails-6.1/config/boot.rb +++ /dev/null @@ -1,13 +0,0 @@ -require 'rubygems' - -# Set up gems listed in the Gemfile. -gemfile = File.expand_path('../../Gemfile', __FILE__) -begin - ENV['BUNDLE_GEMFILE'] = gemfile - require 'bundler' - Bundler.setup -rescue Bundler::GemNotFound => e - STDERR.puts e.message - STDERR.puts "Try running `bundle install`." - exit! -end if File.exist?(gemfile) diff --git a/spec/rails-6.1/config/database.yml b/spec/rails-6.1/config/database.yml deleted file mode 100644 index 4057667..0000000 --- a/spec/rails-6.1/config/database.yml +++ /dev/null @@ -1,4 +0,0 @@ -test: - adapter: sqlite3 - database: db/query_diet_test.db - verbosity: quiet diff --git a/spec/rails-6.1/config/environment.rb b/spec/rails-6.1/config/environment.rb deleted file mode 100644 index 3a61311..0000000 --- a/spec/rails-6.1/config/environment.rb +++ /dev/null @@ -1,5 +0,0 @@ -# Load the rails application -require File.expand_path('../application', __FILE__) - -# Initialize the rails application -QueryDietSpecApp::Application.initialize! diff --git a/spec/rails-6.1/config/environments/test.rb b/spec/rails-6.1/config/environments/test.rb deleted file mode 100644 index d12619c..0000000 --- a/spec/rails-6.1/config/environments/test.rb +++ /dev/null @@ -1,40 +0,0 @@ -QueryDietSpecApp::Application.configure do - # Settings specified here will take precedence over those in config/application.rb - - # The test environment is used exclusively to run your application's - # test suite. You never need to work with it otherwise. Remember that - # your test database is "scratch space" for the test suite and is wiped - # and recreated between test runs. Don't rely on the data there! - config.cache_classes = true - - # Do not eager load code on boot. This avoids loading your whole application - # just for the purpose of running a single test. If you are using a tool that - # preloads Rails for running tests, you may have to set it to true. - config.eager_load = false - - # Log error messages when you accidentally call methods on nil. - config.whiny_nils = true - - # Show full error reports and disable caching - config.consider_all_requests_local = true - config.action_controller.perform_caching = false - - # Raise exceptions instead of rendering exception templates - config.action_dispatch.show_exceptions = false - - # Disable request forgery protection in test environment - config.action_controller.allow_forgery_protection = false - - # Tell Action Mailer not to deliver emails to the real world. - # The :test delivery method accumulates sent emails in the - # ActionMailer::Base.deliveries array. - config.action_mailer.delivery_method = :test - - # Use SQL instead of Active Record's schema dumper when creating the test database. - # This is necessary if your schema can't be completely dumped by the schema dumper, - # like if you have constraints or database-specific column types - # config.active_record.schema_format = :sql - - # Print deprecation notices to the stderr - config.active_support.deprecation = :stderr -end diff --git a/spec/rails-6.1/config/initializers/backtrace_silencers.rb b/spec/rails-6.1/config/initializers/backtrace_silencers.rb deleted file mode 100644 index 59385cd..0000000 --- a/spec/rails-6.1/config/initializers/backtrace_silencers.rb +++ /dev/null @@ -1,7 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. -# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } - -# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. -# Rails.backtrace_cleaner.remove_silencers! diff --git a/spec/rails-6.1/config/initializers/inflections.rb b/spec/rails-6.1/config/initializers/inflections.rb deleted file mode 100644 index 9e8b013..0000000 --- a/spec/rails-6.1/config/initializers/inflections.rb +++ /dev/null @@ -1,10 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Add new inflection rules using the following format -# (all these examples are active by default): -# ActiveSupport::Inflector.inflections do |inflect| -# inflect.plural /^(ox)$/i, '\1en' -# inflect.singular /^(ox)en/i, '\1' -# inflect.irregular 'person', 'people' -# inflect.uncountable %w( fish sheep ) -# end diff --git a/spec/rails-6.1/config/initializers/mime_types.rb b/spec/rails-6.1/config/initializers/mime_types.rb deleted file mode 100644 index 72aca7e..0000000 --- a/spec/rails-6.1/config/initializers/mime_types.rb +++ /dev/null @@ -1,5 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Add new mime types for use in respond_to blocks: -# Mime::Type.register "text/richtext", :rtf -# Mime::Type.register_alias "text/html", :iphone diff --git a/spec/rails-6.1/config/initializers/session_store.rb b/spec/rails-6.1/config/initializers/session_store.rb deleted file mode 100644 index 7b60489..0000000 --- a/spec/rails-6.1/config/initializers/session_store.rb +++ /dev/null @@ -1,8 +0,0 @@ -# Be sure to restart your server when you modify this file. - -QueryDietSpecApp::Application.config.session_store :cookie_store, :key => '_app_root_session' - -# Use the database for sessions instead of the cookie-based default, -# which shouldn't be used to store highly confidential information -# (create the session table with "rails generate session_migration") -# QueryDietSpecApp::Application.config.session_store :active_record_store diff --git a/spec/rails-6.1/config/routes.rb b/spec/rails-6.1/config/routes.rb deleted file mode 100644 index 01d01a5..0000000 --- a/spec/rails-6.1/config/routes.rb +++ /dev/null @@ -1,59 +0,0 @@ -QueryDietSpecApp::Application.routes.draw do - # The priority is based upon order of creation: - # first created -> highest priority. - - # Sample of regular route: - # match 'products/:id' => 'catalog#view' - # Keep in mind you can assign values other than :controller and :action - - # Sample of named route: - # match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase - # This route can be invoked with purchase_url(:id => product.id) - - # Sample resource route (maps HTTP verbs to controller actions automatically): - # resources :products - - # Sample resource route with options: - # resources :products do - # member do - # get 'short' - # post 'toggle' - # end - # - # collection do - # get 'sold' - # end - # end - - # Sample resource route with sub-resources: - # resources :products do - # resources :comments, :sales - # resource :seller - # end - - # Sample resource route with more complex sub-resources - # resources :products do - # resources :comments - # resources :sales do - # get 'recent', :on => :collection - # end - # end - - # Sample resource route within a namespace: - # namespace :admin do - # # Directs /admin/products/* to Admin::ProductsController - # # (app/controllers/admin/products_controller.rb) - # resources :products - # end - - # You can have the root of your site routed with "root" - # just remember to delete public/index.html. - # root :to => "welcome#index" - - # See how all your routes lay out with "rake routes" - - # This is a legacy wild controller route that's not recommended for RESTful applications. - # Note: This route will make all actions in every controller accessible via GET requests. - get '/query_diet/no_query', to: 'query_diet#no_query' - get '/query_diet/two_queries', to: 'query_diet#two_queries' -end diff --git a/spec/rails-6.1/config/secrets.yml b/spec/rails-6.1/config/secrets.yml deleted file mode 100644 index 03e7cd7..0000000 --- a/spec/rails-6.1/config/secrets.yml +++ /dev/null @@ -1,2 +0,0 @@ -test: - secret_key_base: the_secret diff --git a/spec/rails-6.1/db b/spec/rails-6.1/db deleted file mode 120000 index a21da8a..0000000 --- a/spec/rails-6.1/db +++ /dev/null @@ -1 +0,0 @@ -../shared/db \ No newline at end of file diff --git a/spec/rails-6.1/rcov.opts b/spec/rails-6.1/rcov.opts deleted file mode 100644 index 274ed51..0000000 --- a/spec/rails-6.1/rcov.opts +++ /dev/null @@ -1,2 +0,0 @@ ---exclude "spec/*,gems/*" ---rails \ No newline at end of file diff --git a/spec/rails-6.1/spec/spec_helper.rb b/spec/rails-6.1/spec/spec_helper.rb deleted file mode 100644 index 51f91ec..0000000 --- a/spec/rails-6.1/spec/spec_helper.rb +++ /dev/null @@ -1,29 +0,0 @@ -$: << File.join(File.dirname(__FILE__), "/../lib" ) - -# Set the default environment to sqlite3's in_memory database -ENV['RAILS_ENV'] ||= 'test' - -# Load the Rails environment and testing framework -require "#{File.dirname(__FILE__)}/../config/environment" -require 'rspec/rails' -require 'database_cleaner' - -FileUtils.rm(Dir.glob("#{Rails.root}/db/*.db"), :force => true) - -# Run the migrations -ActiveRecord::Schema.verbose = false -ActiveRecord::MigrationContext.new("#{Rails.root}/db/migrate", ActiveRecord::Base.connection.schema_migration).migrate - -# For some reason the first time the SqliteAdapter fetches schema information it -# raises an error -Movie.create rescue nil - -# Movie.reset_column_information - -RSpec.configure do |config| - config.use_transactional_fixtures = false - config.use_instantiated_fixtures = false - config.expect_with(:rspec) { |c| c.syntax = :should } - config.mock_with(:rspec) { |c| c.syntax = :should } - config.before { DatabaseCleaner.clean } -end diff --git a/spec/rails-7.0/.gitignore b/spec/rails-7.0/.gitignore deleted file mode 100644 index af64fae..0000000 --- a/spec/rails-7.0/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -.bundle -db/*.sqlite3 -log/*.log -tmp/**/* diff --git a/spec/rails-7.0/Rakefile b/spec/rails-7.0/Rakefile deleted file mode 100644 index 9f60eef..0000000 --- a/spec/rails-7.0/Rakefile +++ /dev/null @@ -1,10 +0,0 @@ -require 'rake' -require 'rspec/core/rake_task' - -desc 'Default: Run all specs for a specific rails version.' -task :default => :spec - -desc "Run all specs for a specific rails version" -RSpec::Core::RakeTask.new(:spec) do |t| - t.pattern = defined?(SPEC) ? SPEC : ['../shared/spec/**/*_spec.rb'] -end diff --git a/spec/rails-7.0/app b/spec/rails-7.0/app deleted file mode 120000 index abbdfa6..0000000 --- a/spec/rails-7.0/app +++ /dev/null @@ -1 +0,0 @@ -../shared/app \ No newline at end of file diff --git a/spec/rails-7.0/config/application.rb b/spec/rails-7.0/config/application.rb deleted file mode 100644 index 3b1ae60..0000000 --- a/spec/rails-7.0/config/application.rb +++ /dev/null @@ -1,50 +0,0 @@ -require File.expand_path('../boot', __FILE__) - -require 'rails' -# Pick the frameworks you want: -require 'active_model/railtie' -require 'active_job/railtie' -require 'active_record/railtie' -# require 'active_storage/engine' -require 'action_controller/railtie' -require 'action_mailer/railtie' -# require 'action_mailbox/engine' -# require 'action_text/engine' -require 'action_view/railtie' -# require 'action_cable/engine' -# require 'sprockets/railtie' -require 'rails/test_unit/railtie' - -# If you have a Gemfile, require the gems listed there, including any gems -# you've limited to :test, :development, or :production. -Bundler.require(:default, Rails.env) if defined?(Bundler) - - -module QueryDietSpecApp - class Application < Rails::Application - # Initialize configuration defaults for originally generated Rails version. - config.load_defaults 7.0 - - config.encoding = "utf-8" - - config.cache_classes = true - config.whiny_nils = true - - config.consider_all_requests_local = true - config.action_controller.perform_caching = false - - config.action_dispatch.show_exceptions = false - - config.action_controller.allow_forgery_protection = false - - config.action_mailer.delivery_method = :test - - config.active_support.deprecation = :stderr - - # config.active_record.sqlite3.represent_boolean_as_integer = true - - config.root = File.expand_path('../..', __FILE__) - - # railties.plugins << Rails::Plugin.new(File.expand_path('../../../../..', __FILE__)) - end -end diff --git a/spec/rails-7.0/config/boot.rb b/spec/rails-7.0/config/boot.rb deleted file mode 100644 index ab6cb37..0000000 --- a/spec/rails-7.0/config/boot.rb +++ /dev/null @@ -1,13 +0,0 @@ -require 'rubygems' - -# Set up gems listed in the Gemfile. -gemfile = File.expand_path('../../Gemfile', __FILE__) -begin - ENV['BUNDLE_GEMFILE'] = gemfile - require 'bundler' - Bundler.setup -rescue Bundler::GemNotFound => e - STDERR.puts e.message - STDERR.puts "Try running `bundle install`." - exit! -end if File.exist?(gemfile) diff --git a/spec/rails-7.0/config/database.yml b/spec/rails-7.0/config/database.yml deleted file mode 100644 index 4057667..0000000 --- a/spec/rails-7.0/config/database.yml +++ /dev/null @@ -1,4 +0,0 @@ -test: - adapter: sqlite3 - database: db/query_diet_test.db - verbosity: quiet diff --git a/spec/rails-7.0/config/environment.rb b/spec/rails-7.0/config/environment.rb deleted file mode 100644 index 3a61311..0000000 --- a/spec/rails-7.0/config/environment.rb +++ /dev/null @@ -1,5 +0,0 @@ -# Load the rails application -require File.expand_path('../application', __FILE__) - -# Initialize the rails application -QueryDietSpecApp::Application.initialize! diff --git a/spec/rails-7.0/config/environments/test.rb b/spec/rails-7.0/config/environments/test.rb deleted file mode 100644 index d12619c..0000000 --- a/spec/rails-7.0/config/environments/test.rb +++ /dev/null @@ -1,40 +0,0 @@ -QueryDietSpecApp::Application.configure do - # Settings specified here will take precedence over those in config/application.rb - - # The test environment is used exclusively to run your application's - # test suite. You never need to work with it otherwise. Remember that - # your test database is "scratch space" for the test suite and is wiped - # and recreated between test runs. Don't rely on the data there! - config.cache_classes = true - - # Do not eager load code on boot. This avoids loading your whole application - # just for the purpose of running a single test. If you are using a tool that - # preloads Rails for running tests, you may have to set it to true. - config.eager_load = false - - # Log error messages when you accidentally call methods on nil. - config.whiny_nils = true - - # Show full error reports and disable caching - config.consider_all_requests_local = true - config.action_controller.perform_caching = false - - # Raise exceptions instead of rendering exception templates - config.action_dispatch.show_exceptions = false - - # Disable request forgery protection in test environment - config.action_controller.allow_forgery_protection = false - - # Tell Action Mailer not to deliver emails to the real world. - # The :test delivery method accumulates sent emails in the - # ActionMailer::Base.deliveries array. - config.action_mailer.delivery_method = :test - - # Use SQL instead of Active Record's schema dumper when creating the test database. - # This is necessary if your schema can't be completely dumped by the schema dumper, - # like if you have constraints or database-specific column types - # config.active_record.schema_format = :sql - - # Print deprecation notices to the stderr - config.active_support.deprecation = :stderr -end diff --git a/spec/rails-7.0/config/initializers/backtrace_silencers.rb b/spec/rails-7.0/config/initializers/backtrace_silencers.rb deleted file mode 100644 index 59385cd..0000000 --- a/spec/rails-7.0/config/initializers/backtrace_silencers.rb +++ /dev/null @@ -1,7 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. -# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } - -# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. -# Rails.backtrace_cleaner.remove_silencers! diff --git a/spec/rails-7.0/config/initializers/inflections.rb b/spec/rails-7.0/config/initializers/inflections.rb deleted file mode 100644 index 9e8b013..0000000 --- a/spec/rails-7.0/config/initializers/inflections.rb +++ /dev/null @@ -1,10 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Add new inflection rules using the following format -# (all these examples are active by default): -# ActiveSupport::Inflector.inflections do |inflect| -# inflect.plural /^(ox)$/i, '\1en' -# inflect.singular /^(ox)en/i, '\1' -# inflect.irregular 'person', 'people' -# inflect.uncountable %w( fish sheep ) -# end diff --git a/spec/rails-7.0/config/initializers/mime_types.rb b/spec/rails-7.0/config/initializers/mime_types.rb deleted file mode 100644 index 72aca7e..0000000 --- a/spec/rails-7.0/config/initializers/mime_types.rb +++ /dev/null @@ -1,5 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Add new mime types for use in respond_to blocks: -# Mime::Type.register "text/richtext", :rtf -# Mime::Type.register_alias "text/html", :iphone diff --git a/spec/rails-7.0/config/initializers/session_store.rb b/spec/rails-7.0/config/initializers/session_store.rb deleted file mode 100644 index 7b60489..0000000 --- a/spec/rails-7.0/config/initializers/session_store.rb +++ /dev/null @@ -1,8 +0,0 @@ -# Be sure to restart your server when you modify this file. - -QueryDietSpecApp::Application.config.session_store :cookie_store, :key => '_app_root_session' - -# Use the database for sessions instead of the cookie-based default, -# which shouldn't be used to store highly confidential information -# (create the session table with "rails generate session_migration") -# QueryDietSpecApp::Application.config.session_store :active_record_store diff --git a/spec/rails-7.0/config/routes.rb b/spec/rails-7.0/config/routes.rb deleted file mode 100644 index a47aef9..0000000 --- a/spec/rails-7.0/config/routes.rb +++ /dev/null @@ -1,4 +0,0 @@ -QueryDietSpecApp::Application.routes.draw do - get '/query_diet/no_query', to: 'query_diet#no_query' - get '/query_diet/two_queries', to: 'query_diet#two_queries' -end diff --git a/spec/rails-7.0/config/secrets.yml b/spec/rails-7.0/config/secrets.yml deleted file mode 100644 index 03e7cd7..0000000 --- a/spec/rails-7.0/config/secrets.yml +++ /dev/null @@ -1,2 +0,0 @@ -test: - secret_key_base: the_secret diff --git a/spec/rails-7.0/db b/spec/rails-7.0/db deleted file mode 120000 index a21da8a..0000000 --- a/spec/rails-7.0/db +++ /dev/null @@ -1 +0,0 @@ -../shared/db \ No newline at end of file diff --git a/spec/rails-7.0/rcov.opts b/spec/rails-7.0/rcov.opts deleted file mode 100644 index 29cbdb5..0000000 --- a/spec/rails-7.0/rcov.opts +++ /dev/null @@ -1,3 +0,0 @@ ---exclude "spec/*,gems/*" ---rails - diff --git a/spec/rails-7.0/spec/spec_helper.rb b/spec/rails-7.0/spec/spec_helper.rb deleted file mode 100644 index 51f91ec..0000000 --- a/spec/rails-7.0/spec/spec_helper.rb +++ /dev/null @@ -1,29 +0,0 @@ -$: << File.join(File.dirname(__FILE__), "/../lib" ) - -# Set the default environment to sqlite3's in_memory database -ENV['RAILS_ENV'] ||= 'test' - -# Load the Rails environment and testing framework -require "#{File.dirname(__FILE__)}/../config/environment" -require 'rspec/rails' -require 'database_cleaner' - -FileUtils.rm(Dir.glob("#{Rails.root}/db/*.db"), :force => true) - -# Run the migrations -ActiveRecord::Schema.verbose = false -ActiveRecord::MigrationContext.new("#{Rails.root}/db/migrate", ActiveRecord::Base.connection.schema_migration).migrate - -# For some reason the first time the SqliteAdapter fetches schema information it -# raises an error -Movie.create rescue nil - -# Movie.reset_column_information - -RSpec.configure do |config| - config.use_transactional_fixtures = false - config.use_instantiated_fixtures = false - config.expect_with(:rspec) { |c| c.syntax = :should } - config.mock_with(:rspec) { |c| c.syntax = :should } - config.before { DatabaseCleaner.clean } -end diff --git a/spec/rails-7.1/.gitignore b/spec/rails-7.1/.gitignore deleted file mode 100644 index af64fae..0000000 --- a/spec/rails-7.1/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -.bundle -db/*.sqlite3 -log/*.log -tmp/**/* diff --git a/spec/rails-7.1/Rakefile b/spec/rails-7.1/Rakefile deleted file mode 100644 index 9f60eef..0000000 --- a/spec/rails-7.1/Rakefile +++ /dev/null @@ -1,10 +0,0 @@ -require 'rake' -require 'rspec/core/rake_task' - -desc 'Default: Run all specs for a specific rails version.' -task :default => :spec - -desc "Run all specs for a specific rails version" -RSpec::Core::RakeTask.new(:spec) do |t| - t.pattern = defined?(SPEC) ? SPEC : ['../shared/spec/**/*_spec.rb'] -end diff --git a/spec/rails-7.1/app b/spec/rails-7.1/app deleted file mode 120000 index abbdfa6..0000000 --- a/spec/rails-7.1/app +++ /dev/null @@ -1 +0,0 @@ -../shared/app \ No newline at end of file diff --git a/spec/rails-7.1/config/application.rb b/spec/rails-7.1/config/application.rb deleted file mode 100644 index 1c53702..0000000 --- a/spec/rails-7.1/config/application.rb +++ /dev/null @@ -1,38 +0,0 @@ -require File.expand_path('../boot', __FILE__) - -require 'rails' -# Pick the frameworks you want: -require 'active_model/railtie' -require 'active_job/railtie' -require 'active_record/railtie' -# require 'active_storage/engine' -require 'action_controller/railtie' -require 'action_mailer/railtie' -# require 'action_mailbox/engine' -# require 'action_text/engine' -require 'action_view/railtie' -# require 'action_cable/engine' -# require 'sprockets/railtie' -require 'rails/test_unit/railtie' - -# If you have a Gemfile, require the gems listed there, including any gems -# you've limited to :test, :development, or :production. -Bundler.require(:default, Rails.env) if defined?(Bundler) - - -module QueryDietSpecApp - class Application < Rails::Application - # Initialize configuration defaults for originally generated Rails version. - config.load_defaults 7.1 - - # Please, add to the `ignore` list any other `lib` subdirectories that do - # not contain `.rb` files, or that should not be reloaded or eager loaded. - # Common ones are `templates`, `generators`, or `middleware`, for example. - config.autoload_lib(ignore: %w(assets tasks)) - - config.encoding = "utf-8" - config.root = File.expand_path('../..', __FILE__) - - # railties.plugins << Rails::Plugin.new(File.expand_path('../../../../..', __FILE__)) - end -end diff --git a/spec/rails-7.1/config/boot.rb b/spec/rails-7.1/config/boot.rb deleted file mode 100644 index ab6cb37..0000000 --- a/spec/rails-7.1/config/boot.rb +++ /dev/null @@ -1,13 +0,0 @@ -require 'rubygems' - -# Set up gems listed in the Gemfile. -gemfile = File.expand_path('../../Gemfile', __FILE__) -begin - ENV['BUNDLE_GEMFILE'] = gemfile - require 'bundler' - Bundler.setup -rescue Bundler::GemNotFound => e - STDERR.puts e.message - STDERR.puts "Try running `bundle install`." - exit! -end if File.exist?(gemfile) diff --git a/spec/rails-7.1/config/database.yml b/spec/rails-7.1/config/database.yml deleted file mode 100644 index 4057667..0000000 --- a/spec/rails-7.1/config/database.yml +++ /dev/null @@ -1,4 +0,0 @@ -test: - adapter: sqlite3 - database: db/query_diet_test.db - verbosity: quiet diff --git a/spec/rails-7.1/config/environment.rb b/spec/rails-7.1/config/environment.rb deleted file mode 100644 index 3a61311..0000000 --- a/spec/rails-7.1/config/environment.rb +++ /dev/null @@ -1,5 +0,0 @@ -# Load the rails application -require File.expand_path('../application', __FILE__) - -# Initialize the rails application -QueryDietSpecApp::Application.initialize! diff --git a/spec/rails-7.1/config/environments/test.rb b/spec/rails-7.1/config/environments/test.rb deleted file mode 100644 index 6049334..0000000 --- a/spec/rails-7.1/config/environments/test.rb +++ /dev/null @@ -1,64 +0,0 @@ -require "active_support/core_ext/integer/time" - -# The test environment is used exclusively to run your application's -# test suite. You never need to work with it otherwise. Remember that -# your test database is "scratch space" for the test suite and is wiped -# and recreated between test runs. Don't rely on the data there! - -Rails.application.configure do - # Settings specified here will take precedence over those in config/application.rb. - - # While tests run files are not watched, reloading is not necessary. - config.enable_reloading = false - - # Eager loading loads your entire application. When running a single test locally, - # this is usually not necessary, and can slow down your test suite. However, it's - # recommended that you enable it in continuous integration systems to ensure eager - # loading is working properly before deploying your code. - config.eager_load = ENV["CI"].present? - - # Configure public file server for tests with Cache-Control for performance. - config.public_file_server.enabled = true - config.public_file_server.headers = { - "Cache-Control" => "public, max-age=#{1.hour.to_i}" - } - - # Show full error reports and disable caching. - config.consider_all_requests_local = true - config.action_controller.perform_caching = false - config.cache_store = :null_store - - # Render exception templates for rescuable exceptions and raise for other exceptions. - config.action_dispatch.show_exceptions = :rescuable - - # Disable request forgery protection in test environment. - config.action_controller.allow_forgery_protection = false - - # Store uploaded files on the local file system in a temporary directory. - # config.active_storage.service = :test - - config.action_mailer.perform_caching = false - - # Tell Action Mailer not to deliver emails to the real world. - # The :test delivery method accumulates sent emails in the - # ActionMailer::Base.deliveries array. - config.action_mailer.delivery_method = :test - - # Print deprecation notices to the stderr. - config.active_support.deprecation = :stderr - - # Raise exceptions for disallowed deprecations. - config.active_support.disallowed_deprecation = :raise - - # Tell Active Support which deprecation messages to disallow. - config.active_support.disallowed_deprecation_warnings = [] - - # Raises error for missing translations. - # config.i18n.raise_on_missing_translations = true - - # Annotate rendered view with file names. - # config.action_view.annotate_rendered_view_with_filenames = true - - # Raise error when a before_action's only/except options reference missing actions - config.action_controller.raise_on_missing_callback_actions = true -end diff --git a/spec/rails-7.1/config/initializers/backtrace_silencers.rb b/spec/rails-7.1/config/initializers/backtrace_silencers.rb deleted file mode 100644 index 59385cd..0000000 --- a/spec/rails-7.1/config/initializers/backtrace_silencers.rb +++ /dev/null @@ -1,7 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. -# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } - -# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. -# Rails.backtrace_cleaner.remove_silencers! diff --git a/spec/rails-7.1/config/initializers/inflections.rb b/spec/rails-7.1/config/initializers/inflections.rb deleted file mode 100644 index 9e8b013..0000000 --- a/spec/rails-7.1/config/initializers/inflections.rb +++ /dev/null @@ -1,10 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Add new inflection rules using the following format -# (all these examples are active by default): -# ActiveSupport::Inflector.inflections do |inflect| -# inflect.plural /^(ox)$/i, '\1en' -# inflect.singular /^(ox)en/i, '\1' -# inflect.irregular 'person', 'people' -# inflect.uncountable %w( fish sheep ) -# end diff --git a/spec/rails-7.1/config/initializers/mime_types.rb b/spec/rails-7.1/config/initializers/mime_types.rb deleted file mode 100644 index 72aca7e..0000000 --- a/spec/rails-7.1/config/initializers/mime_types.rb +++ /dev/null @@ -1,5 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Add new mime types for use in respond_to blocks: -# Mime::Type.register "text/richtext", :rtf -# Mime::Type.register_alias "text/html", :iphone diff --git a/spec/rails-7.1/config/initializers/session_store.rb b/spec/rails-7.1/config/initializers/session_store.rb deleted file mode 100644 index 7b60489..0000000 --- a/spec/rails-7.1/config/initializers/session_store.rb +++ /dev/null @@ -1,8 +0,0 @@ -# Be sure to restart your server when you modify this file. - -QueryDietSpecApp::Application.config.session_store :cookie_store, :key => '_app_root_session' - -# Use the database for sessions instead of the cookie-based default, -# which shouldn't be used to store highly confidential information -# (create the session table with "rails generate session_migration") -# QueryDietSpecApp::Application.config.session_store :active_record_store diff --git a/spec/rails-7.1/config/routes.rb b/spec/rails-7.1/config/routes.rb deleted file mode 100644 index a47aef9..0000000 --- a/spec/rails-7.1/config/routes.rb +++ /dev/null @@ -1,4 +0,0 @@ -QueryDietSpecApp::Application.routes.draw do - get '/query_diet/no_query', to: 'query_diet#no_query' - get '/query_diet/two_queries', to: 'query_diet#two_queries' -end diff --git a/spec/rails-7.1/config/secrets.yml b/spec/rails-7.1/config/secrets.yml deleted file mode 100644 index 03e7cd7..0000000 --- a/spec/rails-7.1/config/secrets.yml +++ /dev/null @@ -1,2 +0,0 @@ -test: - secret_key_base: the_secret diff --git a/spec/rails-7.1/db b/spec/rails-7.1/db deleted file mode 120000 index a21da8a..0000000 --- a/spec/rails-7.1/db +++ /dev/null @@ -1 +0,0 @@ -../shared/db \ No newline at end of file diff --git a/spec/rails-7.1/rcov.opts b/spec/rails-7.1/rcov.opts deleted file mode 100644 index 29cbdb5..0000000 --- a/spec/rails-7.1/rcov.opts +++ /dev/null @@ -1,3 +0,0 @@ ---exclude "spec/*,gems/*" ---rails - diff --git a/spec/rails-7.1/spec/spec_helper.rb b/spec/rails-7.1/spec/spec_helper.rb deleted file mode 100644 index 18e474b..0000000 --- a/spec/rails-7.1/spec/spec_helper.rb +++ /dev/null @@ -1,27 +0,0 @@ -$: << File.join(File.dirname(__FILE__), "/../lib" ) - -# Set the default environment to sqlite3's in_memory database -ENV['RAILS_ENV'] ||= 'test' - -# Load the Rails environment and testing framework -require "#{File.dirname(__FILE__)}/../config/environment" -require 'rspec/rails' -require 'database_cleaner' - -FileUtils.rm(Dir.glob("#{Rails.root}/db/*.db"), :force => true) - -# Run the migrations -ActiveRecord::Schema.verbose = false -ActiveRecord::MigrationContext.new("#{Rails.root}/db/migrate", ActiveRecord::Base.connection.schema_migration).migrate - -# For some reason the first time the SqliteAdapter fetches schema information it -# raises an error -Movie.create rescue nil - -# Movie.reset_column_information - -RSpec.configure do |config| - config.expect_with(:rspec) { |c| c.syntax = :should } - config.mock_with(:rspec) { |c| c.syntax = :should } - config.before { DatabaseCleaner.clean } -end diff --git a/spec/rails-7.2/.gitignore b/spec/rails-7.2/.gitignore deleted file mode 100644 index af64fae..0000000 --- a/spec/rails-7.2/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -.bundle -db/*.sqlite3 -log/*.log -tmp/**/* diff --git a/spec/rails-7.2/Rakefile b/spec/rails-7.2/Rakefile deleted file mode 100644 index 9f60eef..0000000 --- a/spec/rails-7.2/Rakefile +++ /dev/null @@ -1,10 +0,0 @@ -require 'rake' -require 'rspec/core/rake_task' - -desc 'Default: Run all specs for a specific rails version.' -task :default => :spec - -desc "Run all specs for a specific rails version" -RSpec::Core::RakeTask.new(:spec) do |t| - t.pattern = defined?(SPEC) ? SPEC : ['../shared/spec/**/*_spec.rb'] -end diff --git a/spec/rails-7.2/app b/spec/rails-7.2/app deleted file mode 120000 index abbdfa6..0000000 --- a/spec/rails-7.2/app +++ /dev/null @@ -1 +0,0 @@ -../shared/app \ No newline at end of file diff --git a/spec/rails-7.2/config/application.rb b/spec/rails-7.2/config/application.rb deleted file mode 100644 index 74671b8..0000000 --- a/spec/rails-7.2/config/application.rb +++ /dev/null @@ -1,38 +0,0 @@ -require File.expand_path('../boot', __FILE__) - -require 'rails' -# Pick the frameworks you want: -require 'active_model/railtie' -require 'active_job/railtie' -require 'active_record/railtie' -# require 'active_storage/engine' -require 'action_controller/railtie' -require 'action_mailer/railtie' -# require 'action_mailbox/engine' -# require 'action_text/engine' -require 'action_view/railtie' -# require 'action_cable/engine' -# require 'sprockets/railtie' -require 'rails/test_unit/railtie' - -# If you have a Gemfile, require the gems listed there, including any gems -# you've limited to :test, :development, or :production. -Bundler.require(:default, Rails.env) if defined?(Bundler) - - -module QueryDietSpecApp - class Application < Rails::Application - # Initialize configuration defaults for originally generated Rails version. - config.load_defaults 7.2 - - # Please, add to the `ignore` list any other `lib` subdirectories that do - # not contain `.rb` files, or that should not be reloaded or eager loaded. - # Common ones are `templates`, `generators`, or `middleware`, for example. - config.autoload_lib(ignore: %w(assets tasks)) - - config.encoding = "utf-8" - config.root = File.expand_path('../..', __FILE__) - - # railties.plugins << Rails::Plugin.new(File.expand_path('../../../../..', __FILE__)) - end -end diff --git a/spec/rails-7.2/config/boot.rb b/spec/rails-7.2/config/boot.rb deleted file mode 100644 index ab6cb37..0000000 --- a/spec/rails-7.2/config/boot.rb +++ /dev/null @@ -1,13 +0,0 @@ -require 'rubygems' - -# Set up gems listed in the Gemfile. -gemfile = File.expand_path('../../Gemfile', __FILE__) -begin - ENV['BUNDLE_GEMFILE'] = gemfile - require 'bundler' - Bundler.setup -rescue Bundler::GemNotFound => e - STDERR.puts e.message - STDERR.puts "Try running `bundle install`." - exit! -end if File.exist?(gemfile) diff --git a/spec/rails-7.2/config/database.yml b/spec/rails-7.2/config/database.yml deleted file mode 100644 index 4057667..0000000 --- a/spec/rails-7.2/config/database.yml +++ /dev/null @@ -1,4 +0,0 @@ -test: - adapter: sqlite3 - database: db/query_diet_test.db - verbosity: quiet diff --git a/spec/rails-7.2/config/environment.rb b/spec/rails-7.2/config/environment.rb deleted file mode 100644 index 3a61311..0000000 --- a/spec/rails-7.2/config/environment.rb +++ /dev/null @@ -1,5 +0,0 @@ -# Load the rails application -require File.expand_path('../application', __FILE__) - -# Initialize the rails application -QueryDietSpecApp::Application.initialize! diff --git a/spec/rails-7.2/config/environments/test.rb b/spec/rails-7.2/config/environments/test.rb deleted file mode 100644 index 92346c4..0000000 --- a/spec/rails-7.2/config/environments/test.rb +++ /dev/null @@ -1,67 +0,0 @@ -require "active_support/core_ext/integer/time" - -# The test environment is used exclusively to run your application's -# test suite. You never need to work with it otherwise. Remember that -# your test database is "scratch space" for the test suite and is wiped -# and recreated between test runs. Don't rely on the data there! - -Rails.application.configure do - # Settings specified here will take precedence over those in config/application.rb. - - # While tests run files are not watched, reloading is not necessary. - config.enable_reloading = false - - # Eager loading loads your entire application. When running a single test locally, - # this is usually not necessary, and can slow down your test suite. However, it's - # recommended that you enable it in continuous integration systems to ensure eager - # loading is working properly before deploying your code. - config.eager_load = false - - # Configure public file server for tests with Cache-Control for performance. - config.public_file_server.headers = { "Cache-Control" => "public, max-age=#{1.hour.to_i}" } - - # Show full error reports and disable caching. - config.consider_all_requests_local = true - config.action_controller.perform_caching = false - config.cache_store = :null_store - - # Render exception templates for rescuable exceptions and raise for other exceptions. - config.action_dispatch.show_exceptions = :rescuable - - # Disable request forgery protection in test environment. - config.action_controller.allow_forgery_protection = false - - # Store uploaded files on the local file system in a temporary directory. - # config.active_storage.service = :test - - # Disable caching for Action Mailer templates even if Action Controller - # caching is enabled. - config.action_mailer.perform_caching = false - - # Tell Action Mailer not to deliver emails to the real world. - # The :test delivery method accumulates sent emails in the - # ActionMailer::Base.deliveries array. - config.action_mailer.delivery_method = :test - - # Unlike controllers, the mailer instance doesn't have any context about the - # incoming request so you'll need to provide the :host parameter yourself. - config.action_mailer.default_url_options = { host: "www.example.com" } - - # Print deprecation notices to the stderr. - config.active_support.deprecation = :stderr - - # Raise exceptions for disallowed deprecations. - config.active_support.disallowed_deprecation = :raise - - # Tell Active Support which deprecation messages to disallow. - config.active_support.disallowed_deprecation_warnings = [] - - # Raises error for missing translations. - # config.i18n.raise_on_missing_translations = true - - # Annotate rendered view with file names. - # config.action_view.annotate_rendered_view_with_filenames = true - - # Raise error when a before_action's only/except options reference missing actions. - config.action_controller.raise_on_missing_callback_actions = true -end diff --git a/spec/rails-7.2/config/initializers/backtrace_silencers.rb b/spec/rails-7.2/config/initializers/backtrace_silencers.rb deleted file mode 100644 index 59385cd..0000000 --- a/spec/rails-7.2/config/initializers/backtrace_silencers.rb +++ /dev/null @@ -1,7 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. -# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } - -# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. -# Rails.backtrace_cleaner.remove_silencers! diff --git a/spec/rails-7.2/config/initializers/inflections.rb b/spec/rails-7.2/config/initializers/inflections.rb deleted file mode 100644 index 9e8b013..0000000 --- a/spec/rails-7.2/config/initializers/inflections.rb +++ /dev/null @@ -1,10 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Add new inflection rules using the following format -# (all these examples are active by default): -# ActiveSupport::Inflector.inflections do |inflect| -# inflect.plural /^(ox)$/i, '\1en' -# inflect.singular /^(ox)en/i, '\1' -# inflect.irregular 'person', 'people' -# inflect.uncountable %w( fish sheep ) -# end diff --git a/spec/rails-7.2/config/initializers/mime_types.rb b/spec/rails-7.2/config/initializers/mime_types.rb deleted file mode 100644 index 72aca7e..0000000 --- a/spec/rails-7.2/config/initializers/mime_types.rb +++ /dev/null @@ -1,5 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Add new mime types for use in respond_to blocks: -# Mime::Type.register "text/richtext", :rtf -# Mime::Type.register_alias "text/html", :iphone diff --git a/spec/rails-7.2/config/initializers/session_store.rb b/spec/rails-7.2/config/initializers/session_store.rb deleted file mode 100644 index 7b60489..0000000 --- a/spec/rails-7.2/config/initializers/session_store.rb +++ /dev/null @@ -1,8 +0,0 @@ -# Be sure to restart your server when you modify this file. - -QueryDietSpecApp::Application.config.session_store :cookie_store, :key => '_app_root_session' - -# Use the database for sessions instead of the cookie-based default, -# which shouldn't be used to store highly confidential information -# (create the session table with "rails generate session_migration") -# QueryDietSpecApp::Application.config.session_store :active_record_store diff --git a/spec/rails-7.2/config/routes.rb b/spec/rails-7.2/config/routes.rb deleted file mode 100644 index a47aef9..0000000 --- a/spec/rails-7.2/config/routes.rb +++ /dev/null @@ -1,4 +0,0 @@ -QueryDietSpecApp::Application.routes.draw do - get '/query_diet/no_query', to: 'query_diet#no_query' - get '/query_diet/two_queries', to: 'query_diet#two_queries' -end diff --git a/spec/rails-7.2/db b/spec/rails-7.2/db deleted file mode 120000 index a21da8a..0000000 --- a/spec/rails-7.2/db +++ /dev/null @@ -1 +0,0 @@ -../shared/db \ No newline at end of file diff --git a/spec/rails-7.2/rcov.opts b/spec/rails-7.2/rcov.opts deleted file mode 100644 index 29cbdb5..0000000 --- a/spec/rails-7.2/rcov.opts +++ /dev/null @@ -1,3 +0,0 @@ ---exclude "spec/*,gems/*" ---rails - diff --git a/spec/rails-7.2/spec/spec_helper.rb b/spec/rails-7.2/spec/spec_helper.rb deleted file mode 100644 index 1425a1a..0000000 --- a/spec/rails-7.2/spec/spec_helper.rb +++ /dev/null @@ -1,27 +0,0 @@ -$: << File.join(File.dirname(__FILE__), "/../lib" ) - -# Set the default environment to sqlite3's in_memory database -ENV['RAILS_ENV'] ||= 'test' - -# Load the Rails environment and testing framework -require "#{File.dirname(__FILE__)}/../config/environment" -require 'rspec/rails' -require 'database_cleaner' - -FileUtils.rm(Dir.glob("#{Rails.root}/db/*.db"), :force => true) - -# Run the migrations -ActiveRecord::Schema.verbose = false -ActiveRecord::MigrationContext.new("#{Rails.root}/db/migrate").migrate - -# For some reason the first time the SqliteAdapter fetches schema information it -# raises an error -Movie.create rescue nil - -# Movie.reset_column_information - -RSpec.configure do |config| - config.expect_with(:rspec) { |c| c.syntax = :should } - config.mock_with(:rspec) { |c| c.syntax = :should } - config.before { DatabaseCleaner.clean } -end diff --git a/spec/shared/app/controllers/application_controller.rb b/spec/shared/app/controllers/application_controller.rb deleted file mode 100644 index 09705d1..0000000 --- a/spec/shared/app/controllers/application_controller.rb +++ /dev/null @@ -1,2 +0,0 @@ -class ApplicationController < ActionController::Base -end diff --git a/spec/shared/app/controllers/query_diet_controller.rb b/spec/shared/app/controllers/query_diet_controller.rb deleted file mode 100644 index 922be8c..0000000 --- a/spec/shared/app/controllers/query_diet_controller.rb +++ /dev/null @@ -1,13 +0,0 @@ -class QueryDietController < ApplicationController - - layout 'screen' - - def no_query - end - - def two_queries - Movie.create! - Movie.all.to_a - end - -end diff --git a/spec/shared/app/views/layouts/screen.html.erb b/spec/shared/app/views/layouts/screen.html.erb deleted file mode 100644 index f100c7a..0000000 --- a/spec/shared/app/views/layouts/screen.html.erb +++ /dev/null @@ -1,7 +0,0 @@ - -
- <%= query_diet_widget %> -- No query. -
diff --git a/spec/shared/app/views/query_diet/two_queries.html.erb b/spec/shared/app/views/query_diet/two_queries.html.erb deleted file mode 100644 index b2b40e0..0000000 --- a/spec/shared/app/views/query_diet/two_queries.html.erb +++ /dev/null @@ -1,3 +0,0 @@ -- Two queries. -
diff --git a/spec/shared/db/.gitignore b/spec/shared/db/.gitignore deleted file mode 100644 index 81e8b4d..0000000 --- a/spec/shared/db/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -*.db -*.db-shm -*.db-wal diff --git a/spec/shared/db/migrate/001_create_movies.rb b/spec/shared/db/migrate/001_create_movies.rb deleted file mode 100644 index 94d0b79..0000000 --- a/spec/shared/db/migrate/001_create_movies.rb +++ /dev/null @@ -1,16 +0,0 @@ -migration_class = Rails.version > '5' ? ActiveRecord::Migration[4.2] : ActiveRecord::Migration - -class CreateMovies < migration_class - - def self.up - create_table :movies do |t| - t.string :title - t.integer :year - end - end - - def self.down - drop_table :movies - end - -end diff --git a/spec/shared/spec/integration/widget_spec.rb b/spec/shared/spec/integration/widget_spec.rb deleted file mode 100644 index b393c70..0000000 --- a/spec/shared/spec/integration/widget_spec.rb +++ /dev/null @@ -1,23 +0,0 @@ -require 'spec_helper' - -describe 'The widget', type: :feature do - - it "should be included via a helper" do - visit '/query_diet/two_queries' - page.should have_css('div#query_diet') - end - - it 'should show the correct number of queries' do - visit '/query_diet/no_query' - page.should have_css('#query_diet', :text => '0 /') - visit '/query_diet/two_queries' - page.should have_css('#query_diet', :text => '2 /') - end - - it 'should reset the queries after each request' do - visit '/query_diet/two_queries' - visit '/query_diet/two_queries' - page.should have_css('#query_diet', :text => '2 /') - end - -end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb new file mode 100644 index 0000000..6236e63 --- /dev/null +++ b/spec/spec_helper.rb @@ -0,0 +1,21 @@ +# Set the default environment to sqlite3's in_memory database +ENV['RAILS_ENV'] ||= 'test' + +# Runtime dependencies +require 'rails/all' +require_relative './support/app' +require 'rspec/rails' + +require 'gemika' +require 'byebug' +require 'query_diet' + +# Require all files in spec/support +Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].sort.each {|f| require f} + +Gemika::RSpec.configure_clean_database_before_example + +Gemika::RSpec.configure do |config| + config.expect_with(:rspec) { |c| c.syntax = [:should, :expect] } + config.mock_with(:rspec) { |c| c.syntax = [:should, :expect] } +end diff --git a/spec/support/app.rb b/spec/support/app.rb new file mode 100644 index 0000000..207b12e --- /dev/null +++ b/spec/support/app.rb @@ -0,0 +1,15 @@ +class SpecApp < Rails::Application +end + +Rails.application = SpecApp.instance + +if defined?(Rails.application.secrets) + Rails.application.secrets.secret_key_base = 'the_secret' + Rails.application.secrets.secret_token = 'the_secret' +end + +class ActionController::Base + def _routes + Rails.application.routes + end +end diff --git a/spec/support/database.github.yml b/spec/support/database.github.yml new file mode 100644 index 0000000..9a09c07 --- /dev/null +++ b/spec/support/database.github.yml @@ -0,0 +1,13 @@ +mysql: + database: test + username: root + password: password + host: 127.0.0.1 + port: 3306 + +postgresql: + database: test + host: localhost + username: postgres + password: postgres + port: 5432 diff --git a/spec/support/database.rb b/spec/support/database.rb new file mode 100644 index 0000000..df0e56f --- /dev/null +++ b/spec/support/database.rb @@ -0,0 +1,8 @@ +Gemika::Database.new.rewrite_schema! do + + create_table :movies do |t| + t.string :title + t.integer :year + end + +end diff --git a/spec/support/database.sample.yml b/spec/support/database.sample.yml new file mode 100644 index 0000000..6d9ecd8 --- /dev/null +++ b/spec/support/database.sample.yml @@ -0,0 +1,10 @@ +mysql: + database: query_diet_test + host: localhost + username: root + password: secret + +postgresql: + database: query_diet_test + user: + password: diff --git a/spec/shared/app/models/movie.rb b/spec/support/models.rb similarity index 92% rename from spec/shared/app/models/movie.rb rename to spec/support/models.rb index e3cec97..13d73ce 100644 --- a/spec/shared/app/models/movie.rb +++ b/spec/support/models.rb @@ -1,3 +1,3 @@ -class Movie < ActiveRecord::Base - -end +class Movie < ActiveRecord::Base + +end