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

moozzi
Copy link
Contributor

@moozzi moozzi commented May 10, 2023

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

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

@moozzi moozzi force-pushed the add_spec_for_proc_dup branch from f70d0b8 to e12a895 Compare May 10, 2023 14:47
@moozzi moozzi 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

@moozzi moozzi force-pushed the add_spec_for_proc_dup branch from e12a895 to 2b8e143 Compare May 11, 2023 11:46
remove trailing whitespace
@moozzi moozzi force-pushed the add_spec_for_proc_dup branch from 2b8e143 to 4f98b60 Compare May 11, 2023 11:47
@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