From 9e53a0b142f06540ee886ccf107299bdfc2ca3d6 Mon Sep 17 00:00:00 2001 From: naruse Date: Thu, 10 Mar 2011 01:35:56 +0000 Subject: [PATCH] * lib/test/unit.rb (Test::Unit::Runner::Worker#read): fix for the case when IO#read or IO#gets returns nil. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31082 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ lib/test/unit.rb | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 777a459ed2..9924369c26 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Thu Mar 10 10:09:35 2011 NARUSE, Yui + + * lib/test/unit.rb (Test::Unit::Runner::Worker#read): fix for the case + when IO#read or IO#gets returns nil. + Thu Mar 10 07:12:03 2011 Ryan Davis * lib/rubygems*: Import rubygems 1.6.2 (release candidate @ 2026fbb5) diff --git a/lib/test/unit.rb b/lib/test/unit.rb index 5114e401d9..a69c039cc3 100644 --- a/lib/test/unit.rb +++ b/lib/test/unit.rb @@ -274,7 +274,8 @@ module Test end def read - ((@status == :quit) ? @io.read : @io.gets).chomp + res = (@status == :quit) ? @io.read : @io.gets + res && res.chomp end def close