diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-01-19 06:20:49 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-01-19 06:20:49 +0000 |
commit | d6c22be4e7dd9a4931461043580fc29f8439d692 (patch) | |
tree | 1fc731f3bdecc41bd15147816f85b94447448e35 /test/ruby/test_file_exhaustive.rb | |
parent | 81d3b071b909bd3c8c00c5b2dc5b175113ca82a2 (diff) | |
download | ruby-d6c22be4e7dd9a4931461043580fc29f8439d692.tar.gz |
* test/ruby/test_file_exhaustive.rb (test_expand_path): ignore case of paths on DOSISH platforms.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34339 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_file_exhaustive.rb')
-rw-r--r-- | test/ruby/test_file_exhaustive.rb | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/test/ruby/test_file_exhaustive.rb b/test/ruby/test_file_exhaustive.rb index cd2760a72f..b0bb16243a 100644 --- a/test/ruby/test_file_exhaustive.rb +++ b/test/ruby/test_file_exhaustive.rb @@ -398,14 +398,15 @@ class TestFileExhaustive < Test::Unit::TestCase assert_equal(@file, File.expand_path(@file + "::$DATA")) assert_match(/\Ac:\//i, File.expand_path('c:'), '[ruby-core:31591]') assert_match(/\Ac:\//i, File.expand_path('c:foo', 'd:/bar')) - assert_equal('c:/bar/foo', File.expand_path('c:foo', 'c:/bar')) - assert_equal('C:/bar/foo', File.expand_path('c:foo', 'C:/bar')) + assert_match(%r'\Ac:/bar/foo\z'i, File.expand_path('c:foo', 'c:/bar')) end if drive = Dir.pwd[%r'\A(?:[a-z]:|//[^/]+/[^/]+)'i] - assert_equal("z:/foo", File.expand_path('/foo', "z:/bar")) - assert_equal("//host/share/foo", File.expand_path('/foo', "//host/share/bar")) + assert_match(%r"\Az:/foo\z"i, File.expand_path('/foo', "z:/bar")) + assert_match(%r"\A//host/share/foo\z"i, File.expand_path('/foo', "//host/share/bar").downcase) + assert_match(%r"\A#{drive}/foo\z"i, File.expand_path('/foo')) + else + assert_equal("/foo", File.expand_path('/foo')) end - assert_equal("#{drive}/foo", File.expand_path('/foo')) assert_kind_of(String, File.expand_path("~")) if ENV["HOME"] assert_raise(ArgumentError) { File.expand_path("~foo_bar_baz_unknown_user_wahaha") } assert_raise(ArgumentError) { File.expand_path("~foo_bar_baz_unknown_user_wahaha", "/") } |