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 WithKeywordsWhenNeeded #476

Open
JonRowe opened this issue Dec 29, 2020 · 1 comment
Open

Remove WithKeywordsWhenNeeded #476

JonRowe opened this issue Dec 29, 2020 · 1 comment
Milestone

Comments

@JonRowe
Copy link
Member

JonRowe commented Dec 29, 2020

My approach to try to split args and use **kwargs for delegation is incorrect and needs to be phased out in 3.x and this module removed in 4.x. The problem is that arguments that implement to_hash are wrongly detected (with no way to know they are not) and converted. Only ruby2_keywords delegation is safe.

See rspec/rspec-expectations#1241 as an example of this issue.

@JonRowe JonRowe added this to the 4.0 milestone Dec 29, 2020
@pirj pirj changed the title Remove WithKeywordsWhenNecessary Remove WithKeywordsWhenNeeded Dec 29, 2020
@pirj
Copy link
Member

pirj commented Dec 30, 2020

A WIP attempt to get rid of WKWN in rspec-core rspec/rspec-core@684b584

I've been running it on Ruby 3.0, and the spec fails with something like foo: keyword missing for those lines where we pass a hash:

include_examples "...", { foo: "..." }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants