diff options
Diffstat (limited to 'spec/ruby/optional/capi/hash_spec.rb')
-rw-r--r-- | spec/ruby/optional/capi/hash_spec.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/ruby/optional/capi/hash_spec.rb b/spec/ruby/optional/capi/hash_spec.rb index a60467a66b..a0e49ffc4c 100644 --- a/spec/ruby/optional/capi/hash_spec.rb +++ b/spec/ruby/optional/capi/hash_spec.rb @@ -50,6 +50,22 @@ describe "C-API Hash function" do end end + ruby_version_is '3.2' do + describe "rb_hash_new_capa" do + it "returns a new hash" do + @s.rb_hash_new_capa(3).should == {} + end + + it "creates a hash with no default proc" do + @s.rb_hash_new_capa(3) {}.default_proc.should be_nil + end + + it "raises RuntimeError when negative index is provided" do + -> { @s.rb_hash_new_capa(-1) }.should raise_error(RuntimeError, "st_table too big") + end + end + end + describe "rb_ident_hash_new" do it "returns a new compare by identity hash" do result = @s.rb_ident_hash_new |