summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-07-29 23:51:53 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-07-29 23:51:53 +0000
commitc03e220cf30d9f4cd8a1cb3d8ebb2d779862c0bc (patch)
tree01f8cec9d71a5e9b486db5043413552604995064 /test
parentf2c87d53953fad3c674c72081e5f3b86391d4dbd (diff)
* file.c (file_expand_path): home directory must be absolute.
[ruby-core:31537] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@28796 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_file_exhaustive.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/ruby/test_file_exhaustive.rb b/test/ruby/test_file_exhaustive.rb
index 22039bafc4..7d3169cc81 100644
--- a/test/ruby/test_file_exhaustive.rb
+++ b/test/ruby/test_file_exhaustive.rb
@@ -356,6 +356,18 @@ class TestFileExhaustive < Test::Unit::TestCase
assert_kind_of(String, File.expand_path("~"))
assert_raise(ArgumentError) { File.expand_path("~foo_bar_baz_unknown_user_wahaha") }
assert_raise(ArgumentError) { File.expand_path("~foo_bar_baz_unknown_user_wahaha", "/") }
+ begin
+ bug3630 = '[ruby-core:31537]'
+ home = ENV["HOME"]
+ ENV["HOME"] = nil
+ assert_raise(ArgumentError) { File.expand_path("~") }
+ ENV["HOME"] = "~"
+ assert_raise(ArgumentError, bug3630) { File.expand_path("~") }
+ ENV["HOME"] = "."
+ assert_raise(ArgumentError, bug3630) { File.expand_path("~") }
+ ensure
+ ENV["HOME"] = home
+ end
end
def test_basename