Skip to content

Commit 7c3e302

Browse files
committed
Change the spec to use a non-dummy encoding
1 parent 3986992 commit 7c3e302

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

spec/ruby/library/stringio/write_spec.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,17 @@
2121
describe "StringIO#write transcoding" do
2222
describe "when UTF-16 encoding is set" do
2323
it "accepts a UTF-8-encoded string and transcodes it" do
24-
io = StringIO.new.set_encoding(Encoding::UTF_16)
24+
io = StringIO.new.set_encoding(Encoding::UTF_16BE)
2525
utf8_str = "hello"
2626

2727
io.write(utf8_str)
2828

2929
result = io.string
3030
expected = [
31-
254, 255, # BOM
3231
0, 104, 0, 101, 0, 108, 0, 108, 0, 111, # double-width "hello"
3332
]
3433

35-
io.external_encoding.should == Encoding::UTF_16
34+
io.external_encoding.should == Encoding::UTF_16BE
3635
result.bytes.should == expected
3736
end
3837
end

0 commit comments

Comments
 (0)