mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Update to ruby/spec@740ccc8
This commit is contained in:
parent
c99e4c4278
commit
83decbb62b
110 changed files with 1285 additions and 842 deletions
21
spec/ruby/core/unboundmethod/public_spec.rb
Normal file
21
spec/ruby/core/unboundmethod/public_spec.rb
Normal file
|
@ -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
|
Loading…
Add table
Add a link
Reference in a new issue