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 Proc#dup #1019

Merged
merged 1 commit into from
May 11, 2023
Merged

Conversation

AI-Mozi
Copy link
Contributor

@AI-Mozi AI-Mozi commented May 10, 2023

#1016
New spec for Proc#dup from this issue.

Proc#dup returns an instance of subclass. [Bug #17545]

@AI-Mozi AI-Mozi marked this pull request as ready for review May 10, 2023 15:02
it "returns an instance of subclass" do
cl = Class.new(Proc)

cl.new{}.dup.class.should == cl
Copy link
Member

Choose a reason for hiding this comment

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

major: It's a shared example and used for both #dup and #clone methods. It's parametrised with @method instance variable, that may be either :clone or :dup.

So instead of hardcoding the dup method call (cl.new{}.dup) a proper method should be called with send(@method) (you may find a test case above useful).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ohh.. that makes sense

remove trailing whitespace
@andrykonchin
Copy link
Member

Thank you for the specs!

@andrykonchin andrykonchin merged commit e19f670 into ruby:master May 11, 2023
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