Closed adriangohjw closed 4 months ago
These changes improve compatibility and ensure test reliability across different Ruby versions, particularly focusing on Ruby 2.7. Updates include adjustments to gem dependencies based on Ruby versions and a fix for failing tests due to an uninitialized constant Rack::Handler
in Ruby 2.7.
File Path | Change Summary |
---|---|
spec/generator_specs/generator_spec.rb | Adjusted logic to handle gem dependencies based on varying Ruby versions, ensuring compatibility. |
CHANGELOG.md | Documented the fix for failing tests in Ruby 2.7 caused by Rack::Handler::Puma.respond_to?(:config) . |
Objective | Addressed | Explanation |
---|---|---|
Tests failed due to uninitialized constant Rack::Handler (#498) |
✅ |
In the land of code, where bugs reside,
A bunny hopped, eyes open wide.
With a tweak and a twist, for Ruby’s sake,
Tests now pass, no more mistakes.
Gems aligned, dependencies free,
CodeRabbit hops with pure glee. 🐇✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
@justin808 all tests passed in my fork (https://github.com/adriangohjw/shakapacker/pull/3)
Summary
Closes https://github.com/shakacode/shakapacker/issues/498
Tests for ruby 2.7 were failing due to unless
Rack::Handler::Puma.respond_to?(:config)
in Capybara gem v3.39.2 or earlier.This is caused by
Rack
moving to a separate gemRackup
in Rack 3Issue resolved in Capybara v3.40.0, but Ruby 2.7 support dropped; last compatible version is v3.39.2.
Hardcoding
rack
to be version 2 fixes itPull Request checklist
~- [ ] Add/update test to cover these changes~
capybara
which only happens in test environment, do you think we need to write a test for it? (@justin808)~- [ ] Update documentation~
Other Information
Unsure if this is the best fix, but it's the easiest one I could come up with that does not require huge changes - especially when Ruby 2.7 has already passed EOL 2023-03-31
Summary by CodeRabbit
Rack::Handler::Puma.respond_to?(:config)
.