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

Change #public?, #protected? and #private? specs for Method #1033

Merged

Conversation

AI-Mozi
Copy link
Contributor

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

#1016
[Bug #18729] [Bug #18751] [Bug #18435]

The following deprecated methods are removed.
Method#public?, Method#private?, Method#protected?,
UnboundMethod#public?, UnboundMethod#private?, UnboundMethod#protected?

@AI-Mozi AI-Mozi force-pushed the add_specs_for_method_pub_priv_prot branch from 8e3c032 to 07ecf8f Compare May 17, 2023 09:36
@AI-Mozi AI-Mozi marked this pull request as ready for review May 17, 2023 10:27
@AI-Mozi AI-Mozi force-pushed the add_specs_for_method_pub_priv_prot branch from 07ecf8f to 551e0f2 Compare May 17, 2023 10:28
ruby_version_is "3.2" do
it "has been removed" do
obj = UnboundMethodSpecs::Methods.new
obj.method(:my_private_method).should_not.respond_to?(:private?)
Copy link
Member

Choose a reason for hiding this comment

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

major: Without unbind it will test an instance of Method, not UnboundMethod

Suggested change
obj.method(:my_private_method).should_not.respond_to?(:private?)
obj.method(:my_private_method).unbind.should_not.respond_to?(:private?)

@AI-Mozi AI-Mozi force-pushed the add_specs_for_method_pub_priv_prot branch from 551e0f2 to e8e2c0d Compare May 17, 2023 12:31
@andrykonchin
Copy link
Member

Thank you for the specs!

@andrykonchin andrykonchin merged commit a33e563 into ruby:master May 17, 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