diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-04-06 17:05:50 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-04-06 17:05:50 +0000 |
commit | 7dd103822bad37ea8f8b08e38d7023fe9a261887 (patch) | |
tree | 610ba8e98c58ac6002faee2bba4c0602c795f34b | |
parent | 2e507f34e0518b13fa0aa26d3de5cac7e54ae804 (diff) | |
download | ruby-7dd103822bad37ea8f8b08e38d7023fe9a261887.tar.gz |
* 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
-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')) |