summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorglass <glass@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-01-09 04:26:15 +0000
committerglass <glass@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-01-09 04:26:15 +0000
commit1ff3e23fe844f780e88f971c759cfc2184f508a3 (patch)
treeae34bcec6ee1cb4f12f753d92b251b51792e7efb
parentbc0577c6c8607d57a13282a34c80f64fe9bf1eef (diff)
* test/ruby/test_require.rb: improve test for r38744.
fix to use Tempfile instead of temporary file in current directory. the patch is from nobu (Nobuyoshi Nakada). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38745 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--test/ruby/test_require.rb12
2 files changed, 14 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 6ea54fd..09eca39 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Wed Jan 9 13:20:23 2013 Masaki Matsushita <glass.saga@gmail.com>
+
+ * test/ruby/test_require.rb: improve test for r38744.
+ fix to use Tempfile instead of temporary file in current directory.
+ the patch is from nobu (Nobuyoshi Nakada).
+
Wed Jan 9 09:53:23 2013 Masaki Matsushita <glass.saga@gmail.com>
* load.c (load_lock): fix not to delete thread shield twice.
diff --git a/test/ruby/test_require.rb b/test/ruby/test_require.rb
index 1ff2d78..e7e9e85 100644
--- a/test/ruby/test_require.rb
+++ b/test/ruby/test_require.rb
@@ -607,22 +607,26 @@ class TestRequire < Test::Unit::TestCase
def test_require_with_loaded_features_pop
bug7530 = '[ruby-core:50645]'
- assert_in_out_err([], <<-INPUT, %w(:ok), [], bug7530)
+ script = Tempfile.new(%w'bug-7530- .rb')
+ script.close
+ dir, base = File.split(script.path)
+ assert_in_out_err(["-C", dir, "-", base], <<-INPUT, %w(:ok), [], bug7530)
+ PATH = ARGV.shift
THREADS = 2
ITERATIONS_PER_THREAD = 1000
$: << '.'
- system 'touch __load_path_bench_script__.rb'
THREADS.times.map {
Thread.new do
ITERATIONS_PER_THREAD.times do
- require '__load_path_bench_script__'
+ require PATH
$".pop
end
end
}.each(&:join)
- system 'rm __load_path_bench_script__.rb'
p :ok
INPUT
+ ensure
+ script.close(true) if script
end
end