diff options
Diffstat (limited to 'test/io')
-rw-r--r-- | test/io/console/test_io_console.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/test/io/console/test_io_console.rb b/test/io/console/test_io_console.rb index c4fd08c7eb..1c0b0b5654 100644 --- a/test/io/console/test_io_console.rb +++ b/test/io/console/test_io_console.rb @@ -256,7 +256,11 @@ class TestIO_Console < Test::Unit::TestCase else result = r.readlines(&:chomp) Process.wait(pid) - yield result + if block_given? + yield result + else + result + end ensure r.close if r w.close if w |