diff options
| author | Dan Allen <dan.j.allen@gmail.com> | 2023-03-30 23:57:47 -0600 |
|---|---|---|
| committer | Dan Allen <dan.j.allen@gmail.com> | 2023-03-31 02:14:04 -0600 |
| commit | f0ca263629b06eb6722bbaab3707c1b9d713cfc8 (patch) | |
| tree | 3f84a763dfad4aa0c47a4a54a4885ebc24a1f92c /spec | |
| parent | 24ea726c08e162e1022f971e1e3ce89528b5d9df (diff) | |
add additional tests and docs for loading themes from the classpath
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/converter_spec.rb | 20 | ||||
| -rw-r--r-- | spec/fixtures/pdf-themes.jar | bin | 26524 -> 26844 bytes |
2 files changed, 20 insertions, 0 deletions
diff --git a/spec/converter_spec.rb b/spec/converter_spec.rb index 2d0ec242..61828862 100644 --- a/spec/converter_spec.rb +++ b/spec/converter_spec.rb @@ -264,6 +264,26 @@ describe Asciidoctor::PDF::Converter do (expect pdf.find_text font_name: 'Times-Roman').to have_size pdf.text.size end + it 'should resolve theme at root of classloader when pdf-themesdir is uri:classloader:/', if: RUBY_ENGINE == 'jruby' do + require fixture_file 'pdf-themes.jar' + pdf = to_pdf <<~'END', attribute_overrides: { 'pdf-themesdir' => 'uri:classloader:/', 'pdf-theme' => 'custom' }, analyze: true + hi there + END + + text = pdf.find_unique_text 'hi there' + (expect text[:font_color]).to eql '0000FF' + end + + it 'should resolve theme from folder in classloader when pdf-themesdir starts with uri:classloader:', if: RUBY_ENGINE == 'jruby' do + require fixture_file 'pdf-themes.jar' + pdf = to_pdf <<~'END', attribute_overrides: { 'pdf-themesdir' => 'uri:classloader:/pdf-themes', 'pdf-theme' => 'another-custom' }, analyze: true + hi there + END + + text = pdf.find_unique_text 'hi there' + (expect text[:font_color]).to eql 'FF0000' + end + it 'should set text color to black when default-for-print theme is specified' do pdf = to_pdf <<~END, analyze: true = Document Title diff --git a/spec/fixtures/pdf-themes.jar b/spec/fixtures/pdf-themes.jar Binary files differindex c73e3f40..480f954c 100644 --- a/spec/fixtures/pdf-themes.jar +++ b/spec/fixtures/pdf-themes.jar |
