Skip to content

Commit 74fd99a

Browse files
committed
Fix a NoMethodError on Ruby 2.7 caused by Hash#except
## Motivation and Context The gemspec already declares `required_ruby_version >= 2.7.0`, but the conformance Rake task used `Hash#except` to drop the `:port` option before handing the remaining options to `Conformance::ClientRunner`. `Hash#except` was only added in Ruby 3.0, so running `rake conformance` on Ruby 2.7 aborted before any scenario ran, raising `NoMethodError: undefined method except for {}:Hash`. CI missed this because no job runs `rake conformance` on Ruby 2.7: the conformance workflow runs only on Ruby 4.0, while the Ruby 2.7.0 matrix entry runs `rake test` alone. ## How Has This Been Tested? Replace `options.except(:port)` with `options.reject { |key, _| key == :port }`, which has been available since well before Ruby 2.7 and returns an equivalent Hash without mutating the original. `rake conformance` now runs the full suite on Ruby 2.7, and its baseline still passes on current Ruby, verified on Ruby 4.0. ## Breaking Changes None.
1 parent 72400ca commit 74fd99a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Rakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ task :conformance do |t|
3030
options[:verbose] = true if ENV["VERBOSE"]
3131

3232
Conformance::ServerRunner.new(**options).run
33-
Conformance::ClientRunner.new(**options.except(:port)).run
33+
Conformance::ClientRunner.new(**options.reject { |key, _value| key == :port }).run
3434
end
3535

3636
desc "List available conformance scenarios"

0 commit comments

Comments
 (0)