diff options
| author | Dan Allen <dan.j.allen@gmail.com> | 2020-06-14 23:57:14 -0600 |
|---|---|---|
| committer | Dan Allen <dan.j.allen@gmail.com> | 2020-06-15 00:06:44 -0600 |
| commit | d42ad0d397f74d05d7ec2a79585fa3e630871cc1 (patch) | |
| tree | e5af65427fb5f5687068af90e30e22bbbcbf7106 /spec/admonition_spec.rb | |
| parent | 718be5ac6281d5de0373b65e5f359c90eaf20dfc (diff) | |
use default note icon if icon name for admonition cannot be resolved
Diffstat (limited to 'spec/admonition_spec.rb')
| -rw-r--r-- | spec/admonition_spec.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/admonition_spec.rb b/spec/admonition_spec.rb index 7ca42ccc..1bc45a55 100644 --- a/spec/admonition_spec.rb +++ b/spec/admonition_spec.rb @@ -370,6 +370,18 @@ describe 'Asciidoctor::PDF::Converter - Admonition' do (expect icon_text[:string]).to eql ?\uf101 end + it 'should fall back to note icon if icon name cannot be resolved' do + pdf = to_pdf <<~'EOS', pdf_theme: { admonition_icon_warning: { name: nil } }, analyze: true + :icons: font + + WARNING: If the icon name is nil, the default note icon will be used. + EOS + + icon_text = pdf.text[0] + (expect icon_text[:font_name]).to eql 'FontAwesome5Free-Solid' + (expect icon_text[:string]).to eql ?\uf05a + end + it 'should set color of icon to value of stroke_color key specified in theme' do pdf = to_pdf <<~'EOS', pdf_theme: { admonition_icon_note: { stroke_color: '00ff00' } }, analyze: true :icons: font |
