summaryrefslogtreecommitdiff
path: root/test/paths_test.rb
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2018-09-18 05:10:20 -0600
committerDan Allen <dan.j.allen@gmail.com>2018-09-18 05:24:04 -0600
commit2d2ff7dc0198ccc035887f966eab36221f296a4f (patch)
tree3ff57a8ed9e5de1fcf8146d97cc5c24c2d4cc6bd /test/paths_test.rb
parentba6e2687138758c886560788e56e0948f1c25779 (diff)
resolves #2869 preserve UNC path with backslashes on Windows
- convert system path \\server\docs to //server/docs on Windows - clarify that PathResolver#root? does not require path to be posixified
Diffstat (limited to 'test/paths_test.rb')
-rw-r--r--test/paths_test.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/paths_test.rb b/test/paths_test.rb
index 46d369e8..92fc363b 100644
--- a/test/paths_test.rb
+++ b/test/paths_test.rb
@@ -284,11 +284,16 @@ context 'Path Resolver' do
assert_equal File.dirname('//server/docs/file.html'), '//server/docs'
end if windows?
- test 'resolves absolute UNC path if start is absolute and target is relative' do
+ 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')
end
test 'resolves UNC path if target is UNC path' do
+ @resolver.file_separator = '\\'
+ assert_equal '//server/docs/output.html', @resolver.system_path('\\\\server\\docs\\output.html')
+ end
+
+ test 'resolves UNC path if target is posix-style UNC path' do
assert_equal '//server/docs/output.html', @resolver.system_path('//server/docs/output.html')
end