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/encoding_spec.rb | |
parent | 296f68816cf575b3ff920f92aec8a4109a7d81d4 (diff) |
Update to ruby/spec@ec84479
Diffstat (limited to 'spec/ruby/optional/capi/encoding_spec.rb')
-rw-r--r-- | spec/ruby/optional/capi/encoding_spec.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/ruby/optional/capi/encoding_spec.rb b/spec/ruby/optional/capi/encoding_spec.rb index b74a360760..430c2dfcc6 100644 --- a/spec/ruby/optional/capi/encoding_spec.rb +++ b/spec/ruby/optional/capi/encoding_spec.rb @@ -257,6 +257,14 @@ describe "C-API Encoding function" do @s.rb_to_encoding(obj).should == "UTF-8" end + + describe "when the rb_encoding struct is stored in native memory" do + it "can still read the name of the encoding" do + address = @s.rb_to_encoding_native_store(Encoding::UTF_8) + address.should be_kind_of(Integer) + @s.rb_to_encoding_native_name(address).should == "UTF-8" + end + end end describe "rb_to_encoding_index" do |