diff options
author | Benoit Daloze <[email protected]> | 2020-03-28 00:22:51 +0100 |
---|---|---|
committer | Benoit Daloze <[email protected]> | 2020-03-28 00:22:51 +0100 |
commit | f234d51eaba861edea925eabb564a0bee41b96a0 (patch) | |
tree | 3334f36a91fe81ec704f2980ab169231f52c41d0 /spec/ruby/optional/capi/gc_spec.rb | |
parent | 296f68816cf575b3ff920f92aec8a4109a7d81d4 (diff) |
Update to ruby/spec@ec84479
Diffstat (limited to 'spec/ruby/optional/capi/gc_spec.rb')
-rw-r--r-- | spec/ruby/optional/capi/gc_spec.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/ruby/optional/capi/gc_spec.rb b/spec/ruby/optional/capi/gc_spec.rb index 528dd291ba..23e2b7c9ab 100644 --- a/spec/ruby/optional/capi/gc_spec.rb +++ b/spec/ruby/optional/capi/gc_spec.rb @@ -64,4 +64,24 @@ describe "CApiGCSpecs" do @f.rb_gc_register_mark_object(Object.new).should be_nil end end + + describe "rb_gc_latest_gc_info" do + it "raises a TypeError when hash or symbol not given" do + -> { @f.rb_gc_latest_gc_info("foo") }.should raise_error(TypeError) + end + + it "raises an ArgumentError when unknown symbol given" do + -> { @f.rb_gc_latest_gc_info(:unknown) }.should raise_error(ArgumentError) + end + + it "returns the populated hash when a hash is given" do + h = {} + @f.rb_gc_latest_gc_info(h).should == h + h.size.should_not == 0 + end + + it "returns a value when symbol is given" do + @f.rb_gc_latest_gc_info(:state).should be_kind_of(Symbol) + end + end end |