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

Ruby 3.1: Add spec for StructClass#keyword_init? #953

Merged
merged 1 commit into from
Oct 8, 2022

Conversation

citizen428
Copy link
Contributor

This PR adds a spec for StructClass#keyword_init? (feature) as requested in #923.

ruby_version_is "3.1" do
# See https://bugs.ruby-lang.org/issues/18008
describe "StructClass#keyword_init?" do
it "returns true for a struct that accepts keyword arguments to initialize" do
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The description is maybe a bit verbose but i borrowed it from Struct's new_spec.rb for the sake of consistency. Open to make it shorter if requested.

@citizen428 citizen428 changed the title Rbuy 3.1: Add spec for Struct#keyword_init? Ruby 3.1: Add spec for Struct#keyword_init? Oct 8, 2022
@citizen428 citizen428 changed the title Ruby 3.1: Add spec for Struct#keyword_init? Ruby 3.1: Add spec for StructClass#keyword_init? Oct 8, 2022
Copy link
Member

@eregon eregon left a comment

Choose a reason for hiding this comment

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

Looks great, thank you!

@eregon eregon merged commit df9ea91 into ruby:master Oct 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants