Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Use encode helper

  • Loading branch information...
commit 6a6f4ee03bb0b90ca00c081bef221c82d7810218 1 parent d906aaf
@nurse nurse authored
Showing with 6 additions and 16 deletions.
  1. +6 −16 optional/capi/string_spec.rb
View
22 optional/capi/string_spec.rb
@@ -477,22 +477,12 @@ def to_str
@s.rb_str_resize_RSTRING_LEN("test", 2).should == 2
end
- ruby_version_is ""..."1.9" do
- it "increases the size of the string" do
- str = @s.rb_str_resize("test", 12)
- str.size.should == 12
- @s.RSTRING_LEN(str).should == 12
- str[0, 4].should == "test"
- end
- end
-
- ruby_version_is "1.9" do
- it "increases the size of the string" do
- str = @s.rb_str_resize("test", 12)
- str.bytesize.should == 12
- @s.RSTRING_LEN(str).should == 12
- str[0, 4].should == "test"
- end
+ it "increases the size of the string" do
+ expected = Object.encode("test", "US-ASCII")
+ str = @s.rb_str_resize(expected.dup, 12)
+ str.size.should == 12
+ @s.RSTRING_LEN(str).should == 12
+ str[0, 4].should == expected
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.