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

@ -114,28 +114,26 @@ describe "IO#puts" do
lambda { IOSpecs.closed_io.puts("stuff") }.should raise_error(IOError)
end
with_feature :encoding do
it "writes crlf when IO is opened with newline: :crlf" do
File.open(@name, 'wt', newline: :crlf) do |file|
it "writes crlf when IO is opened with newline: :crlf" do
File.open(@name, 'wt', newline: :crlf) do |file|
file.puts
end
File.binread(@name).should == "\r\n"
end
it "writes cr when IO is opened with newline: :cr" do
File.open(@name, 'wt', newline: :cr) do |file|
file.puts
end
File.binread(@name).should == "\r"
end
platform_is_not :windows do # https://bugs.ruby-lang.org/issues/12436
it "writes lf when IO is opened with newline: :lf" do
File.open(@name, 'wt', newline: :lf) do |file|
file.puts
end
File.binread(@name).should == "\r\n"
end
it "writes cr when IO is opened with newline: :cr" do
File.open(@name, 'wt', newline: :cr) do |file|
file.puts
end
File.binread(@name).should == "\r"
end
platform_is_not :windows do # https://bugs.ruby-lang.org/issues/12436
it "writes lf when IO is opened with newline: :lf" do
File.open(@name, 'wt', newline: :lf) do |file|
file.puts
end
File.binread(@name).should == "\n"
end
File.binread(@name).should == "\n"
end
end
end