diff options
Diffstat (limited to 'test/ruby/test_file_exhaustive.rb')
-rw-r--r-- | test/ruby/test_file_exhaustive.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_file_exhaustive.rb b/test/ruby/test_file_exhaustive.rb index f3c36aa38b..d80c430bce 100644 --- a/test/ruby/test_file_exhaustive.rb +++ b/test/ruby/test_file_exhaustive.rb @@ -601,6 +601,13 @@ class TestFileExhaustive < Test::Unit::TestCase assert_equal("#{DRIVE}/dir", File.expand_path("#{DRIVE}/./dir")) end + def test_expand_path_does_not_expand_wildcards + assert_equal("#{DRIVE}/*", File.expand_path("./*", "#{DRIVE}/")) + assert_equal("#{Dir.pwd}/*", File.expand_path("./*", Dir.pwd)) + assert_equal("#{DRIVE}/?", File.expand_path("./?", "#{DRIVE}/")) + assert_equal("#{Dir.pwd}/?", File.expand_path("./?", Dir.pwd)) + end if DRIVE + def test_expand_path_does_not_modify_the_string_argument str = "./a/b/../c" assert_equal("#{Dir.pwd}/a/c", File.expand_path(str, Dir.pwd)) |