summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2022-05-20 04:58:46 -0600
committerDan Allen <dan.j.allen@gmail.com>2022-05-20 04:58:46 -0600
commit281f2b940b6a426241c1ae577f0fab08d35c985e (patch)
tree688783be425b4d41a805f456d8050874a6589988
parent71730a596b9c80cffb5c1e37f8dac6ffedd81155 (diff)
make sure a brand variable can end in color
-rw-r--r--spec/theme_loader_spec.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/theme_loader_spec.rb b/spec/theme_loader_spec.rb
index 82284b3a..b49d1c27 100644
--- a/spec/theme_loader_spec.rb
+++ b/spec/theme_loader_spec.rb
@@ -1235,6 +1235,20 @@ describe Asciidoctor::PDF::ThemeLoader do
(expect theme.heading_font_color).to eql theme.base_font_color
end
+ it 'should resolve variable reference to previously defined color' do
+ theme_data = YAML.safe_load <<~'EOS'
+ brand:
+ blue-color: '0000FF'
+ base:
+ font_color: $brand-blue-color
+ heading:
+ font_color: $base-font-color
+ EOS
+ theme = subject.new.load theme_data
+ (expect theme.base_font_color).to eql '0000FF'
+ (expect theme.heading_font_color).to eql theme.base_font_color
+ end
+
it 'should warn if variable reference cannot be resolved' do
(expect do
theme_data = YAML.safe_load <<~'EOS'