summaryrefslogtreecommitdiff
path: root/test/pathname
diff options
context:
space:
mode:
authorMarc-Andre Lafortune <github@marc-andre.ca>2019-04-03 15:22:18 -0400
committerMarc-André Lafortune <github@marc-andre.ca>2020-09-14 14:18:23 -0400
commit39312cf4d6c2ab3f07d688ad1a467c8f84b58db0 (patch)
treed9d880a04c60437451c7aad7dead0945d832eb70 /test/pathname
parent28e60b0045b5732bca11012d81a5223001faa6b2 (diff)
Optimize Pathname#relative? / absolute?
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/2107
Diffstat (limited to 'test/pathname')
-rw-r--r--test/pathname/test_pathname.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/pathname/test_pathname.rb b/test/pathname/test_pathname.rb
index 77958b6359..dadcd1398c 100644
--- a/test/pathname/test_pathname.rb
+++ b/test/pathname/test_pathname.rb
@@ -269,17 +269,17 @@ class TestPathname < Test::Unit::TestCase
Pathname.new(path).relative?
end
+ defassert(:relative?, true, '')
defassert(:relative?, false, '/')
defassert(:relative?, false, '/a')
defassert(:relative?, false, '/..')
defassert(:relative?, true, 'a')
defassert(:relative?, true, 'a/b')
- if DOSISH_DRIVE_LETTER
- defassert(:relative?, false, 'A:')
- defassert(:relative?, false, 'A:/')
- defassert(:relative?, false, 'A:/a')
- end
+ defassert(:relative?, !DOSISH_DRIVE_LETTER, 'A:.')
+ defassert(:relative?, !DOSISH_DRIVE_LETTER, 'A:')
+ defassert(:relative?, !DOSISH_DRIVE_LETTER, 'A:/')
+ defassert(:relative?, !DOSISH_DRIVE_LETTER, 'A:/a')
if File.dirname('//') == '//'
defassert(:relative?, false, '//')