1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/spec/ruby/library/stringio/binmode_spec.rb
Lars Kanis 94b6933d1c
Set default for Encoding.default_external to UTF-8 on Windows (#2877)
* Use UTF-8 as default for Encoding.default_external on Windows
* Document UTF-8 change on Windows to Encoding.default_external

fix https://bugs.ruby-lang.org/issues/16604
2020-12-08 01:48:37 +09:00

23 lines
569 B
Ruby

require_relative '../../spec_helper'
require_relative 'fixtures/classes'
describe "StringIO#binmode" do
it "returns self" do
io = StringIO.new("example")
io.binmode.should equal(io)
end
it "changes external encoding to BINARY" do
io = StringIO.new
io.external_encoding.should == Encoding.find('external')
io.binmode
io.external_encoding.should == Encoding::BINARY
end
it "does not set internal encoding" do
io = StringIO.new
io.internal_encoding.should == nil
io.binmode
io.internal_encoding.should == nil
end
end