Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tests uninitialized constant rack #501

Merged
merged 3 commits into from
Jul 6, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions spec/generator_specs/generator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,23 @@
))

Bundler.with_unbundled_env do
sh_in_dir({}, BASE_RAILS_APP_PATH, %(
gem update bundler
bundle add shakapacker --path "#{GEM_ROOT}"
))
if RUBY_VERSION.start_with?("2.")
# Bundler's version compatible with Ruby 2 does not support "--path" switch
# Overwriting "rack" version due to unless Rack::Handler::Puma.respond_to?(:config) in Capybara gem v3.39.2 or earlier.
# Issue resolved in Capybara v3.40.0, but Ruby 2.7 support dropped; last compatible version is v3.39.2.
# Ref: https://github.com/shakacode/shakapacker/issues/498
sh_in_dir({}, BASE_RAILS_APP_PATH, %(
gem update bundler
echo 'gem "shakapacker", :path => "#{GEM_ROOT}"' >> Gemfile
echo 'gem "rack", "< 3.0.0"' >> Gemfile
bundle install
))
else
sh_in_dir({}, BASE_RAILS_APP_PATH, %(
gem update bundler
bundle add shakapacker --path "#{GEM_ROOT}"
))
end
end
end

Expand Down