aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorluislavena <luislavena@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-08-29 22:45:24 +0000
committerluislavena <luislavena@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-08-29 22:45:24 +0000
commit608a1f44761bc9a964fdf8a6c2a257374b89e761 (patch)
tree0b195b4a13b6b3528ae466f64ebafc2357dddde4 /test
parente7ddd1fdc3c7807cae6ffa3154bef585c7a4ee8c (diff)
downloadruby-608a1f44761bc9a964fdf8a6c2a257374b89e761.tar.gz
test/ruby/test_file_exhaustive.rb: fix test for HOME-less envs
* test/ruby/test_file_exhaustive.rb: fix test introduced in r36811 for posix environments where HOME is not defined. [ruby-core:47322] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36850 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_file_exhaustive.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/ruby/test_file_exhaustive.rb b/test/ruby/test_file_exhaustive.rb
index 1523823bb7..14e7f5a1b6 100644
--- a/test/ruby/test_file_exhaustive.rb
+++ b/test/ruby/test_file_exhaustive.rb
@@ -461,12 +461,17 @@ class TestFileExhaustive < Test::Unit::TestCase
end
def test_expand_path_encoding_filesystem
+ home = ENV["HOME"]
+ ENV["HOME"] = "#{DRIVE}/UserHome"
+
path = "~".encode("US-ASCII")
dir = "C:/".encode("IBM437")
fs = Encoding.find("filesystem")
assert_equal fs, File.expand_path(path).encoding
assert_equal fs, File.expand_path(path, dir).encoding
+ ensure
+ ENV["HOME"] = home
end
def test_expand_path_home
@@ -595,7 +600,7 @@ class TestFileExhaustive < Test::Unit::TestCase
assert_equal(true, File.expand_path('foo', 'bar').tainted?)
assert_equal(true, File.expand_path('foo', '/bar'.taint).tainted?)
assert_equal(true, File.expand_path('foo'.taint, '/bar').tainted?)
- assert_equal(true, File.expand_path('~').tainted?)
+ assert_equal(true, File.expand_path('~').tainted?) if ENV["HOME"]
if DRIVE
assert_equal(true, File.expand_path('/foo').tainted?)