diff options
Diffstat (limited to 'spec/ruby/optional/capi/string_spec.rb')
-rw-r--r-- | spec/ruby/optional/capi/string_spec.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/ruby/optional/capi/string_spec.rb b/spec/ruby/optional/capi/string_spec.rb index 4da31445fe..1ad35b9e8a 100644 --- a/spec/ruby/optional/capi/string_spec.rb +++ b/spec/ruby/optional/capi/string_spec.rb @@ -1007,4 +1007,28 @@ end str.should == "2345678".encode("UTF-32LE") end end + + describe "rb_utf8_str_new_static" do + it "returns a UTF-8 string of the correct characters and length" do + str = @s.rb_utf8_str_new_static + str.should == "nokogiri" + str.encoding.should == Encoding::UTF_8 + end + end + + describe "rb_utf8_str_new" do + it "returns a UTF-8 string of the correct characters and length" do + str = @s.rb_utf8_str_new + str.should == "nokogiri" + str.encoding.should == Encoding::UTF_8 + end + end + + describe "rb_utf8_str_new_cstr" do + it "returns a UTF-8 string of the correct characters and length" do + str = @s.rb_utf8_str_new_cstr + str.should == "nokogiri" + str.encoding.should == Encoding::UTF_8 + end + end end |