-
-
Notifications
You must be signed in to change notification settings - Fork 765
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
Compatibility of shared_examples with Ruby 3 #2674
Comments
Work here is needed to figure out what they've changed and why this is issuing a warning, I suspect we just haven't considered keyword argument at all and they've just worked due to their hash like nature. The implementation should be agnostic to what is passed in and just pass through the arguments. (Meaning the "alfa" example will not work on ruby 3, but continue to work everywhere else). |
This also affects I was beginning to prepare PRs for these things that simply pass Perhaps this is a sensible time to stop supporting these versions? |
Metadata is a hash, so its not going to work treating it as keyword arguments everywhere, as we expect it to be a hash. So this warning is actually a symptom of mis-using the implementation.... So I'm kind of tempted to issue an explicit warning explaining that rather than trying to add explicit support for this behaviour.
I'm afraid that won't happen until the next major version due to semver. |
Wondering if the change to: - def self.include_examples(name, *args, &block)
- find_and_eval_shared("examples", name, caller.first, *args, &block)
+ def self.include_examples(name, *args, **kwargs, &block)
+ find_and_eval_shared("examples", name, caller.first, *args, **kwargs, &block) will do the job. A temporary measure around warnings can be the usage of |
Related rubocop/rubocop#7584 |
Yeah I mean you should be able to remove the warnings by just accepting the hash as is... |
Would you like to be interested in sending a pull request to fix that issue @WojciechKo ? |
Subject of the issue
Compatibility of
shared_examples
with a "Real" keyword argument from upcoming Ruby 3Your environment
Steps to reproduce
Expected behavior
charlie
example should not produce any warningalfa
should not be supported to follow Ruby 3 changes (?)Actual behavior
Following warning is being printed for
charlie
anddelta
caseThe text was updated successfully, but these errors were encountered: