diff options
| author | Randy Morgan <[email protected]> | 2012-09-14 16:12:14 +0900 |
|---|---|---|
| committer | Randy Morgan <[email protected]> | 2012-09-14 16:12:14 +0900 |
| commit | d92dffcef4b65fdef0d5cead0bc63444d8b34df0 (patch) | |
| tree | a5eb15887b3770fc8ba6ec0b03c519b5098c08e8 /test/stylesheet | |
| parent | bcf38488906554162d1ec6dc04837f802873b567 (diff) | |
| download | caxlsx-d92dffcef4b65fdef0d5cead0bc63444d8b34df0.tar.gz caxlsx-d92dffcef4b65fdef0d5cead0bc63444d8b34df0.zip | |
New fonts should use the default font values before applying custom style options via add_style
Diffstat (limited to 'test/stylesheet')
| -rw-r--r-- | test/stylesheet/tc_styles.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/stylesheet/tc_styles.rb b/test/stylesheet/tc_styles.rb index e43d9b55..b9d0b28a 100644 --- a/test/stylesheet/tc_styles.rb +++ b/test/stylesheet/tc_styles.rb @@ -105,6 +105,19 @@ class TestStyles < Test::Unit::TestCase assert(@styles.parse_alignment_options(:alignment => {}).is_a?(Axlsx::CellAlignment)) end + def test_parse_font_using_defaults + original = @styles.fonts.first + @styles.add_style :b => 1, :sz => 99 + created = @styles.fonts.last + original_attributes = original.instance_values + assert_equal(1, created.b) + assert_equal(99, created.sz) + copied = original_attributes.reject{ |key, value| %w(b sz).include? key } + copied.each do |key, value| + assert_equal(created.instance_values[key], value) + end + end + def test_parse_font_options options = { :fg_color => "FF050505", |
