aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_path.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-04-06 17:05:50 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-04-06 17:05:50 +0000
commit7dd103822bad37ea8f8b08e38d7023fe9a261887 (patch)
tree610ba8e98c58ac6002faee2bba4c0602c795f34b /test/ruby/test_path.rb
parent2e507f34e0518b13fa0aa26d3de5cac7e54ae804 (diff)
downloadruby-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
Diffstat (limited to 'test/ruby/test_path.rb')
-rw-r--r--test/ruby/test_path.rb9
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'))