diff options
| author | Dan Allen <dan.j.allen@gmail.com> | 2019-09-01 23:54:31 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-09-01 23:54:31 -0600 |
| commit | e94c85b0121e60c89b1dc4c4e67670d15bff1af3 (patch) | |
| tree | 1a87150003a716f68d4b353f7fbf5989319ea7b4 /spec | |
| parent | b473ddfa4d83214adb32b0d27f41564ebaf108d5 (diff) | |
resolves #1243 allow font catalog and font fallbacks to be defined as flat keys in theme file (PR #1245)
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/theme_loader_spec.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/theme_loader_spec.rb b/spec/theme_loader_spec.rb index f3ffaef0..5a10ab8b 100644 --- a/spec/theme_loader_spec.rb +++ b/spec/theme_loader_spec.rb @@ -79,6 +79,24 @@ describe Asciidoctor::PDF::ThemeLoader do (expect theme.ulist_marker_disc_content).to eql '0' (expect theme.footer_recto_left_content).to eql 'true' end + + it 'should allow font catalog and font fallbacks to be defined as flat keys' do + theme_data = SafeYAML.load <<~EOS + font_catalog: + Serif: + normal: /path/to/serif-font.ttf + Fallback: + normal: /path/to/fallback-font.ttf + font_fallbacks: + - Fallback + EOS + theme = subject.new.load theme_data + (expect theme.font_catalog).to be_a Hash + (expect theme.font_catalog['Serif']).to be_a Hash + (expect theme.font_catalog['Serif']['normal']).to eql '/path/to/serif-font.ttf' + (expect theme.font_fallbacks).to be_a Array + (expect theme.font_fallbacks).to eql ['Fallback'] + end end context '.load_file' do |
