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 2022-11-07 20:05:30 +01:00
parent c99e4c4278
commit 83decbb62b
110 changed files with 1285 additions and 842 deletions

View file

@ -101,6 +101,20 @@ describe "StringIO#puts when passed 1 or more objects" do
@io.puts ''
@io.string.should == "\n"
end
it "handles concurrent writes correctly" do
n = 8
go = false
threads = n.times.map { |i|
Thread.new {
Thread.pass until go
@io.puts i
}
}
go = true
threads.each(&:join)
@io.string.size.should == n.times.map { |i| "#{i}\n" }.join.size
end
end
describe "StringIO#puts when passed no arguments" do