From e94c85b0121e60c89b1dc4c4e67670d15bff1af3 Mon Sep 17 00:00:00 2001 From: Dan Allen Date: Sun, 1 Sep 2019 23:54:31 -0600 Subject: resolves #1243 allow font catalog and font fallbacks to be defined as flat keys in theme file (PR #1245) --- spec/theme_loader_spec.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'spec') 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 -- cgit v1.2.3