1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
This commit is contained in:
Benoit Daloze 2020-09-30 12:21:48 +02:00
parent ce986b41ca
commit 201d501640
17 changed files with 209 additions and 6 deletions

View file

@ -820,6 +820,15 @@ describe "CApiObject" do
end
end
describe "rb_ivar_count" do
it "returns the number of instance variables" do
obj = Object.new
@o.rb_ivar_count(obj).should == 0
obj.instance_variable_set(:@foo, 42)
@o.rb_ivar_count(obj).should == 1
end
end
describe "rb_ivar_get" do
it "returns the instance variable on an object" do
@o.rb_ivar_get(@test, :@foo).should == @test.instance_eval { @foo }