-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Rails 7.1 in test suite + compatibility (#2353)
* Add Grape.deprecator since using ActiveSupport::Deprecation is deprecated https://edgeguides.rubyonrails.org/7_1_release_notes.html#active-support-deprecations Add railtie for Rails 7.1 app to include Grape.deprecator * Add railtie_spec.rb Add CHANGELOG.md * Fix rubocop * Update CHANGELOG.md * Added Rails 7.1 section in README.md
- Loading branch information
1 parent
d390315
commit 4e2a2ff
Showing
19 changed files
with
126 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# frozen_string_literal: true | ||
|
||
# This file was generated by Appraisal | ||
|
||
source 'https://rubygems.org' | ||
|
||
gem 'rails', '~> 7.1.0' | ||
gem 'tzinfo-data', require: false | ||
|
||
group :development, :test do | ||
gem 'bundler' | ||
gem 'hashie' | ||
gem 'rake' | ||
gem 'rubocop', '1.50.2', require: false | ||
gem 'rubocop-performance', '1.17.1', require: false | ||
gem 'rubocop-rspec', '2.20.0', require: false | ||
end | ||
|
||
group :development do | ||
gem 'appraisal' | ||
gem 'benchmark-ips' | ||
gem 'benchmark-memory' | ||
gem 'guard' | ||
gem 'guard-rspec' | ||
gem 'guard-rubocop' | ||
end | ||
|
||
group :test do | ||
gem 'cookiejar' | ||
gem 'grape-entity', '~> 0.6' | ||
gem 'mime-types' | ||
gem 'rack-jsonp', require: 'rack/jsonp' | ||
gem 'rack-test', '< 2.1' | ||
gem 'rspec', '< 4' | ||
gem 'ruby-grape-danger', '~> 0.2.0', require: false | ||
gem 'simplecov', '~> 0.21.2' | ||
gem 'simplecov-lcov', '~> 0.8.0' | ||
gem 'test-prof', require: false | ||
end | ||
|
||
platforms :jruby do | ||
gem 'racc' | ||
end | ||
|
||
gemspec path: '../' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# frozen_string_literal: true | ||
|
||
module Grape | ||
class Railtie < ::Rails::Railtie | ||
initializer 'grape.deprecator' do |app| | ||
app.deprecators[:grape] = Grape.deprecator | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'test_prof/recipes/rspec/let_it_be' | ||
|
||
TestProf::BeforeAll.adapter = Class.new do | ||
def begin_transaction; end | ||
|
||
def rollback_transaction; end | ||
end.new |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# frozen_string_literal: true | ||
|
||
if defined?(Rails::Railtie) && ActiveSupport.gem_version >= Gem::Version.new('7.1') | ||
describe Grape::Railtie do | ||
describe '.railtie' do | ||
subject { test_app.deprecators[:grape] } | ||
|
||
let(:test_app) do | ||
Class.new(Rails::Application) do | ||
config.eager_load = false | ||
config.load_defaults 7.1 | ||
end | ||
end | ||
|
||
before { test_app.initialize! } | ||
|
||
it { is_expected.to be(Grape.deprecator) } | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters