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

Add helper for running class_exec with keywords when needed #407

Merged
merged 1 commit into from Apr 8, 2020

Conversation

JonRowe
Copy link
Member

@JonRowe JonRowe commented Apr 6, 2020

This is an extraction from a pr on rspec-core but its going to be a repeated pattern to fix keyword arguments across the gem so I'm adding it here. I expect to add more as I find other places that keyword arguments don't work quite right.

The aim will be to keep the string eval to a minimum and this will all be replaced with proper **kwargs in RSpec 4, which I want to release in the later half of this year before the next version of Ruby.

@JonRowe JonRowe force-pushed the kwargs-class-exec branch 4 times, most recently from a82ab9c to 97d3289 Compare April 8, 2020 11:34
Copy link
Member

@benoittgt benoittgt left a comment

Choose a reason for hiding this comment

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

🎉

@JonRowe JonRowe merged commit 5915149 into master Apr 8, 2020
@JonRowe JonRowe deleted the kwargs-class-exec branch April 8, 2020 13:45
@JonRowe
Copy link
Member Author

JonRowe commented Apr 8, 2020

Merged because something odd is going on with the sub builds which means this wasn't picked up on the pinned branch.

Copy link
Member

@pirj pirj left a comment

Choose a reason for hiding this comment

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

Looks good!
Sorry for the late appearance, hard day at work.

JonRowe added a commit that referenced this pull request May 2, 2020
Add helper for running class_exec with keywords when needed
@benoittgt
Copy link
Member

benoittgt commented May 14, 2020

On this subject https://discuss.rubyonrails.org/t/new-2-7-3-0-keyword-argument-pain-point/74980 (cc @JonRowe @pirj )

Probably soon-to-be-released 2.7.2 will remove/reduce the warning regarding keyword arguments.

@JonRowe
Copy link
Member Author

JonRowe commented May 14, 2020

I've added a reply

yujinakayama pushed a commit to yujinakayama/rspec-monorepo that referenced this pull request Oct 6, 2021
…s-class-exec

Add helper for running class_exec with keywords when needed

---
This commit was imported from rspec/rspec-support@ca5db55.
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

Successfully merging this pull request may close these issues.

None yet

3 participants