summaryrefslogtreecommitdiff
path: root/test/paths_test.rb
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2020-11-09 23:49:00 -0700
committerGitHub <noreply@github.com>2020-11-09 23:49:00 -0700
commit9ee28751c2709d939c3e58e6ea4809bc519500ca (patch)
treed7c77b7865c4599d4c70b6659b956cc92871b824 /test/paths_test.rb
parent674960182580d0220401842bf0bee12c2f4259c8 (diff)
add if and unless conditions to tests to make filtering more readable (PR #3844)
- also define windows? as static method for these cases - don't match darwin when detecting Windows
Diffstat (limited to 'test/paths_test.rb')
-rw-r--r--test/paths_test.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/test/paths_test.rb b/test/paths_test.rb
index acef2673..2d6e725f 100644
--- a/test/paths_test.rb
+++ b/test/paths_test.rb
@@ -273,13 +273,13 @@ context 'Path Resolver' do
assert_equal '/usr/share/assets/stylesheet.css', @resolver.system_path('assets/stylesheet.css', '/usr/share')
end
- test 'File.dirname preserves UNC path root on Windows' do
+ test 'File.dirname preserves UNC path root on Windows', if: windows? do
assert_equal File.dirname('\\\\server\\docs\\file.html'), '\\\\server\\docs'
- end if windows?
+ end
- test 'File.dirname preserves posix-style UNC path root on Windows' do
+ test 'File.dirname preserves posix-style UNC path root on Windows', if: windows? do
assert_equal File.dirname('//server/docs/file.html'), '//server/docs'
- end if windows?
+ end
test 'resolves UNC path if start is absolute and target is relative' do
assert_equal '//QA/c$/users/asciidoctor/assets/stylesheet.css', @resolver.system_path('assets/stylesheet.css', '//QA/c$/users/asciidoctor')
@@ -351,12 +351,12 @@ context 'Path Resolver' do
assert_equal '../../shared/partials', result
end
- test 'should return original path if relative path cannot be computed' do
+ test 'should return original path if relative path cannot be computed', if: windows? do
filename = 'D:/path/to/include/file.txt'
base_dir = 'C:/docs'
result = @resolver.relative_path filename, base_dir
assert_equal 'D:/path/to/include/file.txt', result
- end if windows?
+ end
test 'should resolve relative path relative to base dir in unsafe mode' do
base_dir = fixture_path 'base'