Environment
Broken in different ways on JRuby 1.7.24 and 9.0.5.0.
Expected Behavior
For the following script:
file = "temptemp"
File.open(file, "w") {}
File.open(file, File::RDWR) do |f|
f.puts("writing") # writes "writing\r\n"
f.flush # force to disk
gets # do not continue until you can verify it was written right
f.rewind # backup
p f.gets # read it but it should be "writing\n"
end
File.unlink(file)
The comments dictate how it should behave.
Actual Behavior
On JRuby 1.7.24 it will write "writing\r\n" but it will read "writing\r\n". instead of "writing\n".
On JRuby 9.0.5.0 it wil write "writing\n" instead of "writing\r\n" but it will read "writing\n".