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 spec for Array#minmax #795

Merged
merged 1 commit into from
Oct 10, 2020
Merged

Conversation

lxxxvi
Copy link
Contributor

@lxxxvi lxxxvi commented Oct 9, 2020

Hello 👋

Here's a PR for Array#minmax:

  • Added Array#minmax, with a faster implementation than Enumerable#minmax. Bug #15929

After quick pre-discussion I thought to try a different approach.

Instead of copying the file core/enumerable/minmax_spec.rb for Arrays, I moved the existing specs to shared/enumerable/minmax.rb and use it_behaves_like in Enumerable and Array, but with different instance variables.

I am unsure if this is a good/proper solution, what do you think?

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.

This looks great, thanks!

@eregon eregon merged commit 6ce0727 into ruby:master Oct 10, 2020
@lxxxvi lxxxvi deleted the add-Array-minmax-spec branch October 10, 2020 15:51
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