mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* file.c (file_expand_path): home directory must be absolute.
[ruby-core:31537] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28796 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a99de84663
commit
6d56e80ad1
3 changed files with 31 additions and 4 deletions
|
@ -397,6 +397,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
|
||||
assert_incompatible_encoding {|d| File.expand_path(d)}
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue