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

Remove unknown hash keyword arguments #1757

Merged
merged 2 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Please visit [cucumber/CONTRIBUTING.md](https://github.com/cucumber/cucumber/blo

### Fixed
- Fixed an issue where a change to one example in compatibility testing wasn't fully adhered to ([luke-hill](https://github.com/luke-hill))
- Fixed an issue for Ruby 3.4.0 where a default hash instantiation was being picked up as keyword arguments ([Jon Rowe](https://github.com/JonRowe))

### Removed
- Removed support for Ruby 2.7 ([luke-hill](https://github.com/luke-hill))
Expand Down
4 changes: 3 additions & 1 deletion lib/cucumber/multiline_argument/data_table.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ def row(row)
def eof; end
end

NULL_CONVERSIONS = Hash.new(strict: false, proc: ->(cell_value) { cell_value }).freeze
# This is a Hash being initialized with a default value of a Hash, DO NOT REFORMAT TO REMOVE {}
# Future versions [3.4.0+] of ruby will interpret these as keywords and break.
NULL_CONVERSIONS = Hash.new({ strict: false, proc: ->(cell_value) { cell_value } }).freeze
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not simply:

NULL_CONVERSIONS = { strict: false, proc: ->(cell_value) { cell_value } }.freeze

? The Hash.new seems redundant here.
Unless Hash here is not ::Hash?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll be honest, this is very old code and I don't know the precise way it is used. This was the smallest safest change suggested.


# @param data [Core::Test::DataTable] the data for the table
# @param conversion_procs [Hash] see map_column
Expand Down
Loading