mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Update to ruby/spec@7de852d
This commit is contained in:
parent
994833085a
commit
79671ec57e
135 changed files with 4415 additions and 4885 deletions
|
@ -10,19 +10,17 @@ describe :string_length, shared: true do
|
|||
"four".send(@method).should == 4
|
||||
end
|
||||
|
||||
with_feature :encoding do
|
||||
it "returns the length of a string in different encodings" do
|
||||
utf8_str = 'こにちわ' * 100
|
||||
utf8_str.size.should == 400
|
||||
utf8_str.encode(Encoding::UTF_32BE).size.should == 400
|
||||
utf8_str.encode(Encoding::SHIFT_JIS).size.should == 400
|
||||
end
|
||||
it "returns the length of a string in different encodings" do
|
||||
utf8_str = 'こにちわ' * 100
|
||||
utf8_str.size.should == 400
|
||||
utf8_str.encode(Encoding::UTF_32BE).size.should == 400
|
||||
utf8_str.encode(Encoding::SHIFT_JIS).size.should == 400
|
||||
end
|
||||
|
||||
it "returns the length of the new self after encoding is changed" do
|
||||
str = 'こにちわ'
|
||||
str.send(@method)
|
||||
it "returns the length of the new self after encoding is changed" do
|
||||
str = 'こにちわ'
|
||||
str.send(@method)
|
||||
|
||||
str.force_encoding('ASCII-8BIT').send(@method).should == 12
|
||||
end
|
||||
str.force_encoding('ASCII-8BIT').send(@method).should == 12
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue