diff options
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/test_io.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb index c7de83784b..a32369eca5 100644 --- a/test/ruby/test_io.rb +++ b/test/ruby/test_io.rb @@ -2445,6 +2445,19 @@ End end) end + def test_puts_parallel + pipe(proc do |w| + threads = [] + 100.times do + threads << Thread.new { w.puts "hey" } + end + threads.each(&:join) + w.close + end, proc do |r| + assert_equal("hey\n" * 100, r.read) + end) + end + def test_display pipe(proc do |w| "foo".display(w) |
