summaryrefslogtreecommitdiff
path: root/test/fileutils
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-11-11 14:44:18 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-11-11 14:44:18 +0000
commit801c8ab026053547093e4b7d3573ab9d7ff0b5f1 (patch)
tree1dc36305c4caf0771bc30fb1ced677fc7b745179 /test/fileutils
parent08bb9482a07765acba998f3a76f7de442e02187d (diff)
* test/fileutils/test_fileutils.rb: Use assert_join_threads.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48382 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/fileutils')
-rw-r--r--test/fileutils/test_fileutils.rb12
1 files changed, 7 insertions, 5 deletions
diff --git a/test/fileutils/test_fileutils.rb b/test/fileutils/test_fileutils.rb
index d948219959..5a9c1b1243 100644
--- a/test/fileutils/test_fileutils.rb
+++ b/test/fileutils/test_fileutils.rb
@@ -6,6 +6,7 @@ require_relative 'fileasserts'
require 'pathname'
require 'tmpdir'
require 'test/unit'
+require_relative '../ruby/envutil'
class TestFileUtils < Test::Unit::TestCase
TMPROOT = "#{Dir.tmpdir}/fileutils.rb.#{$$}"
@@ -16,11 +17,12 @@ class TestFileUtils < Test::Unit::TestCase
IO.pipe {|read, write|
fu.instance_variable_set(:@fileutils_output, write)
th = Thread.new { read.read }
-
- yield
-
- write.close
- lines = th.value.lines.map {|l| l.chomp }
+ th2 = Thread.new {
+ yield
+ write.close
+ }
+ th_value, _ = assert_join_threads([th, th2])
+ lines = th_value.lines.map {|l| l.chomp }
assert_equal(expected, lines)
}
ensure