1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/spec/ruby/core/method/private_spec.rb
2022-11-07 20:05:30 +01:00

21 lines
631 B
Ruby

require_relative '../../spec_helper'
require_relative 'fixtures/classes'
ruby_version_is "3.1"..."3.2" do
describe "Method#private?" do
it "returns false when the method is public" do
obj = MethodSpecs::Methods.new
obj.method(:my_public_method).private?.should == false
end
it "returns false when the method is protected" do
obj = MethodSpecs::Methods.new
obj.method(:my_protected_method).private?.should == false
end
it "returns true when the method is private" do
obj = MethodSpecs::Methods.new
obj.method(:my_private_method).private?.should == true
end
end
end