Skip to content

Fix test suite for ruby 3.0 change for methods on subclass of Array #255

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

Merged
merged 1 commit into from
Mar 1, 2021

Conversation

mtasaka
Copy link
Contributor

@mtasaka mtasaka commented Feb 21, 2021

With ruby 3.0, especially with ruby/ruby#3690 ,
for subclass of Array, flatten method now returns the instance of Array,
not of the subclass.

To keep the object instance of the subclass, use flatten! instead.

Fixes #254

With ruby 3.0, especially with ruby/ruby#3690 ,
for subclass of Array, `flatten` method now returns the instance of Array,
not of the subclass.

To keep the object instance of the subclass, use `flatten!` instead.
@codeclimate
Copy link

codeclimate bot commented Feb 21, 2021

Code Climate has analyzed commit c1c1503 and detected 0 issues on this pull request.

View more on Code Climate.

@junaruga
Copy link
Contributor

junaruga commented Mar 1, 2021

@rubychan Could you take a look at this PR? You can also add Ruby 3.0 case to this repo's Travis CI to see the result. Thanks.

@korny
Copy link
Member

korny commented Mar 1, 2021

Thank you for the fix!

@korny korny merged commit 4982353 into rubychan:master Mar 1, 2021
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.

ruby 3.0: test/unit/suite.rb fails due to change in flatten behavior for subclass of Array
3 participants