diff options
Diffstat (limited to 'test/ruby/test_path.rb')
-rw-r--r-- | test/ruby/test_path.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/test/ruby/test_path.rb b/test/ruby/test_path.rb index 24fc3a9d25..f4b1baf91c 100644 --- a/test/ruby/test_path.rb +++ b/test/ruby/test_path.rb @@ -226,8 +226,13 @@ class TestPath < Test::Unit::TestCase def test_extname assert_equal('', File.extname('a')) - assert_equal('.rb', File.extname('a.rb')) - assert_equal('', File.extname('a.rb.')) + ext = '.rb' + assert_equal(ext, File.extname('a.rb')) + unless /mswin|bccwin|mingw/ =~ RUBY_PLATFORM + # trailing spaces and dots are ignored on NTFS. + ext = '' + end + assert_equal(ext, File.extname('a.rb.')) assert_equal('', File.extname('a.')) assert_equal('', File.extname('.x')) assert_equal('', File.extname('..x')) |