summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-01-28 07:06:48 +0000
committerkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-01-28 07:06:48 +0000
commit29422e5d31cd632f796966c9d4e9b32ca2368540 (patch)
treed7fdd3129184e74c8480847abae080103fdb1791 /test
parentaea93cbed83381b9ef63c2b7cbcb2d882ea5168f (diff)
* 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
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_require.rb20
1 files changed, 19 insertions, 1 deletions
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