From 7dd103822bad37ea8f8b08e38d7023fe9a261887 Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 6 Apr 2010 17:05:50 +0000 Subject: [PATCH] * test/ruby/test_path.rb (TestPath#test_extname): trailing spaces and dots are ignored on NTFS. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27240 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_path.rb | 9 +++++++-- 1 file 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'))