mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Update to ruby/spec@7de852d
This commit is contained in:
parent
994833085a
commit
79671ec57e
135 changed files with 4415 additions and 4885 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue