mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Test that File.read defaults to text mode
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
This commit is contained in:
parent
ca8daf70fa
commit
c433d36b5b
Notes:
git
2022-08-06 03:34:32 +09:00
1 changed files with 8 additions and 0 deletions
|
@ -104,6 +104,14 @@ describe "IO.read" do
|
|||
str = IO.read(@fname, encoding: Encoding::ISO_8859_1)
|
||||
str.encoding.should == Encoding::ISO_8859_1
|
||||
end
|
||||
|
||||
platform_is :windows do
|
||||
it "reads the file in text mode" do
|
||||
# 0x1A is CTRL+Z and is EOF in Windows text mode.
|
||||
File.binwrite(@fname, "\x1Abbb")
|
||||
IO.read(@fname).should.empty?
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "IO.read from a pipe" do
|
||||
|
|
Loading…
Reference in a new issue