mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Update to ruby/spec@740ccc8
This commit is contained in:
parent
c99e4c4278
commit
83decbb62b
110 changed files with 1285 additions and 842 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue