diff options
| author | Dan Allen <dan.j.allen@gmail.com> | 2022-08-09 23:54:16 -0600 |
|---|---|---|
| committer | Dan Allen <dan.j.allen@gmail.com> | 2022-08-10 01:14:28 -0600 |
| commit | ddb5e3d815470d8260279b2c113789aa29a3cd10 (patch) | |
| tree | 6e7657e8a84ed78fffce81086a3c6fea61639b85 | |
| parent | db094fa705f688af3b3e000f5809b6fb482409af (diff) | |
verify fixed units are resolved before computing value
| -rw-r--r-- | spec/theme_loader_spec.rb | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/spec/theme_loader_spec.rb b/spec/theme_loader_spec.rb index b49d1c27..130fecd1 100644 --- a/spec/theme_loader_spec.rb +++ b/spec/theme_loader_spec.rb @@ -1194,7 +1194,7 @@ describe Asciidoctor::PDF::ThemeLoader do end end - it 'should resolve value with units to PDF point value' do + it 'should resolve value with fixed units to PDF point value' do ['0.5in', '36pt', '48px', '12.7mm', '1.27cm'].each do |val| theme_data = YAML.safe_load <<~EOS footer: @@ -1356,6 +1356,16 @@ describe Asciidoctor::PDF::ThemeLoader do (expect theme.brand_another_string).to eql 'ten-10' end + it 'should resolve fixed units before computing value' do + theme_data = YAML.safe_load <<~'EOS' + title-page: + title: + top: 3in / 4 + EOS + theme = subject.new.load theme_data + (expect theme.title_page_title_top).to eql 54 + end + it 'should apply precision functions to value' do theme_data = YAML.safe_load <<~'EOS' base: |
