From 29422e5d31cd632f796966c9d4e9b32ca2368540 Mon Sep 17 00:00:00 2001 From: kosaki Date: Fri, 28 Jan 2011 07:06:48 +0000 Subject: [PATCH] * test/ruby/test_require.rb (TestRequire#test_require_path_home_{1,2,3}): split from test_require_path_home. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30702 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ test/ruby/test_require.rb | 20 +++++++++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index fb55fb76c0..aeda178b4b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Fri Jan 28 16:04:54 2011 KOSAKI Motohiro + + * test/ruby/test_require.rb (TestRequire#test_require_path_home_{1,2,3}): + split from test_require_path_home. + Fri Jan 28 13:04:38 2011 KOSAKI Motohiro * configure.in (--with-valgrind): Fixed r29683. Now this option diff --git a/test/ruby/test_require.rb b/test/ruby/test_require.rb index 1d61a83e86..49bfa04d14 100644 --- a/test/ruby/test_require.rb +++ b/test/ruby/test_require.rb @@ -46,7 +46,7 @@ class TestRequire < Test::Unit::TestCase assert_match(/\u{221e}\z/, e.message, bug3758) end - def test_require_path_home + def test_require_path_home_1 env_rubypath, env_home = ENV["RUBYPATH"], ENV["HOME"] pathname_too_long = /pathname too long \(ignored\).*\(LoadError\)/m @@ -54,10 +54,28 @@ class TestRequire < Test::Unit::TestCase ENV["HOME"] = "/foo" * 2500 assert_in_out_err(%w(-S test_ruby_test_require), "", [], pathname_too_long) + ensure + env_rubypath ? ENV["RUBYPATH"] = env_rubypath : ENV.delete("RUBYPATH") + env_home ? ENV["HOME"] = env_home : ENV.delete("HOME") + end + + def test_require_path_home_2 + env_rubypath, env_home = ENV["RUBYPATH"], ENV["HOME"] + pathname_too_long = /pathname too long \(ignored\).*\(LoadError\)/m + ENV["RUBYPATH"] = "~" + "/foo" * 2500 ENV["HOME"] = "/foo" assert_in_out_err(%w(-S test_ruby_test_require), "", [], pathname_too_long) + ensure + env_rubypath ? ENV["RUBYPATH"] = env_rubypath : ENV.delete("RUBYPATH") + env_home ? ENV["HOME"] = env_home : ENV.delete("HOME") + end + + def test_require_path_home_3 + env_rubypath, env_home = ENV["RUBYPATH"], ENV["HOME"] + pathname_too_long = /pathname too long \(ignored\).*\(LoadError\)/m + t = Tempfile.new(["test_ruby_test_require", ".rb"]) t.puts "p :ok" t.close