summaryrefslogtreecommitdiff
path: root/test/paths_test.rb
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2014-10-12 23:17:33 -0600
committerDan Allen <dan.j.allen@gmail.com>2014-10-12 23:17:33 -0600
commit99e7600bc976c793425224aec5592fa36696079e (patch)
treee4c0f510d7ed23611b47ef6ed165fa75e5778684 /test/paths_test.rb
parent27322c0a19526f361cc08db18d8a297794401ed5 (diff)
resolves #1144 fix includes that reference absolute Windows paths
- fix support for absolute Windows path as target of include directive - add test for include directive with absolute path target - add tests for UriSniffRx
Diffstat (limited to 'test/paths_test.rb')
-rw-r--r--test/paths_test.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/paths_test.rb b/test/paths_test.rb
index 1503d30d..f6238f22 100644
--- a/test/paths_test.rb
+++ b/test/paths_test.rb
@@ -227,5 +227,16 @@ context 'Path Resolver' do
assert_equal 'master', Asciidoctor::Helpers.rootname('master')
assert_equal 'docs/master', Asciidoctor::Helpers.rootname('docs/master')
end
+
+ test 'UriSniffRx should detect URIs' do
+ assert Asciidoctor::UriSniffRx =~ 'http://example.com'
+ assert Asciidoctor::UriSniffRx =~ 'https://example.com'
+ assert Asciidoctor::UriSniffRx =~ 'data:image/gif;base64,R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs='
+ end
+
+ test 'UriSniffRx should not detect an absolute Windows path as a URI' do
+ assert Asciidoctor::UriSniffRx !~ 'c:/sample.adoc'
+ assert Asciidoctor::UriSniffRx !~ 'c:\\sample.adoc'
+ end
end
end