summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2023-10-23 01:33:46 -0600
committerDan Allen <dan.j.allen@gmail.com>2023-10-23 01:33:46 -0600
commit0d40dc34555e077ab4468c88b9fe09480c9ba851 (patch)
tree7ec8eeb3e5ce8b6f20a451f56a77dbc642f25aa8
parentfb267fb530a0fb0869497b34f9e10ac672eaa52e (diff)
verify templates can be used from classloader when using JRuby
-rw-r--r--test/converter_test.rb13
-rw-r--r--test/fixtures/templates.jarbin0 -> 683 bytes
2 files changed, 13 insertions, 0 deletions
diff --git a/test/converter_test.rb b/test/converter_test.rb
index aba3425a..d01b327b 100644
--- a/test/converter_test.rb
+++ b/test/converter_test.rb
@@ -334,6 +334,19 @@ context 'Converter' do
assert_xpath '//*[@id="toc"]/ul[1]/li', output, 3
assert_xpath '//*[@id="toc"]/ul[1]/li[1][text()="Section One"]', output, 1
end
+
+ test 'resolves templates from classloader when using JRuby', if: jruby? do
+ require fixture_path 'templates.jar'
+ input = <<~'EOS'
+ * foo
+ * bar
+ * baz
+ EOS
+
+ doc = Asciidoctor.load input, template_dir: 'uri:classloader:templates', template_cache: false
+ output = doc.convert
+ assert_includes output, '<span class="principal">foo</span>'
+ end
end
context 'Custom converters' do
diff --git a/test/fixtures/templates.jar b/test/fixtures/templates.jar
new file mode 100644
index 00000000..01ed1d31
--- /dev/null
+++ b/test/fixtures/templates.jar
Binary files differ