From 83decbb62b8b3f1638927033f12b55f9b11f78c6 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Mon, 7 Nov 2022 20:05:30 +0100 Subject: Update to ruby/spec@740ccc8 --- spec/ruby/core/unboundmethod/public_spec.rb | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 spec/ruby/core/unboundmethod/public_spec.rb (limited to 'spec/ruby/core/unboundmethod/public_spec.rb') diff --git a/spec/ruby/core/unboundmethod/public_spec.rb b/spec/ruby/core/unboundmethod/public_spec.rb new file mode 100644 index 0000000000..7b87a03b15 --- /dev/null +++ b/spec/ruby/core/unboundmethod/public_spec.rb @@ -0,0 +1,21 @@ +require_relative '../../spec_helper' +require_relative 'fixtures/classes' + +ruby_version_is "3.1"..."3.2" do + describe "UnboundMethod#public?" do + it "returns true when the method is public" do + obj = UnboundMethodSpecs::Methods.new + obj.method(:my_public_method).unbind.public?.should == true + end + + it "returns false when the method is protected" do + obj = UnboundMethodSpecs::Methods.new + obj.method(:my_protected_method).unbind.public?.should == false + end + + it "returns false when the method is private" do + obj = UnboundMethodSpecs::Methods.new + obj.method(:my_private_method).unbind.public?.should == false + end + end +end -- cgit v1.2.3