about summary refs log tree commit homepage
path: root/test
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2013-10-22 01:38:13 +0000
committerEric Wong <e@80x24.org>2013-10-22 01:43:44 +0000
commit99b99a01060cba03ef6b8d05e23294d196657865 (patch)
tree8d8902b3b18fb955e394f9b132f09cf160e90b49 /test
parent55710a182bb074513abf616697a2c38890c285d2 (diff)
downloadyahns-99b99a01060cba03ef6b8d05e23294d196657865.tar.gz
This is necessary for Ruby 1.9.3 compatibility.
Diffstat (limited to 'test')
-rw-r--r--test/helper.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/test/helper.rb b/test/helper.rb
index 92fd1bc..730b96c 100644
--- a/test/helper.rb
+++ b/test/helper.rb
@@ -3,6 +3,7 @@
 $stdout.sync = $stderr.sync = Thread.abort_on_exception = true
 $-w = true if RUBY_VERSION.to_f >= 2.0
 require 'thread'
+require 'fileutils'
 
 def rubyv
   puts RUBY_DESCRIPTION
@@ -80,13 +81,13 @@ end
 require "tempfile"
 require 'tmpdir'
 class Dir
-  require 'fileutils'
   def Dir.mktmpdir
     begin
       d = "#{Dir.tmpdir}/#$$.#{rand}"
       Dir.mkdir(d)
     rescue Errno::EEXIST
     end while true
+    return d unless block_given?
     begin
       yield d
     ensure