1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
This commit is contained in:
Benoit Daloze 2019-04-28 23:20:11 +02:00
parent 994833085a
commit 79671ec57e
135 changed files with 4415 additions and 4885 deletions

View file

@ -36,22 +36,20 @@ describe "String#bytes" do
end
end
with_feature :encoding do
describe "String#bytes" do
before :each do
@utf8 = "東京"
@ascii = 'Tokyo'
@utf8_ascii = @utf8 + @ascii
end
describe "String#bytes" do
before :each do
@utf8 = "東京"
@ascii = 'Tokyo'
@utf8_ascii = @utf8 + @ascii
end
it "agrees with #getbyte" do
@utf8_ascii.bytes.to_a.each_with_index do |byte,index|
byte.should == @utf8_ascii.getbyte(index)
end
end
it "is unaffected by #force_encoding" do
@utf8.force_encoding('ASCII').bytes.to_a.should == @utf8.bytes.to_a
it "agrees with #getbyte" do
@utf8_ascii.bytes.to_a.each_with_index do |byte,index|
byte.should == @utf8_ascii.getbyte(index)
end
end
it "is unaffected by #force_encoding" do
@utf8.force_encoding('ASCII').bytes.to_a.should == @utf8.bytes.to_a
end
end