diff options
| author | Ali Mujtaba <[email protected]> | 2019-10-15 00:37:56 +0500 |
|---|---|---|
| committer | Stefan Daschek <[email protected]> | 2019-10-29 01:40:55 +0100 |
| commit | eaa635a3e4a519556d9e6fe0191afba9aa9125d7 (patch) | |
| tree | 0dfafe9114b2ed8aebb2819bc87a225e3e57d5c9 /test/stylesheet/tc_styles.rb | |
| parent | 2cdaed0178d95c8f0e63ae60c94cfd8bd787e5c6 (diff) | |
| download | caxlsx-eaa635a3e4a519556d9e6fe0191afba9aa9125d7.tar.gz caxlsx-eaa635a3e4a519556d9e6fe0191afba9aa9125d7.zip | |
fix validate document with font option underline
Diffstat (limited to 'test/stylesheet/tc_styles.rb')
| -rw-r--r-- | test/stylesheet/tc_styles.rb | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/test/stylesheet/tc_styles.rb b/test/stylesheet/tc_styles.rb index eb1680ad..72bf1466 100644 --- a/test/stylesheet/tc_styles.rb +++ b/test/stylesheet/tc_styles.rb @@ -124,7 +124,7 @@ class TestStyles < Test::Unit::TestCase :sz => 20, :b => 1, :i => 1, - :u => 1, + :u => :single, :strike => 1, :outline => 1, :shadow => 1, @@ -232,4 +232,30 @@ class TestStyles < Test::Unit::TestCase style = @styles.add_style :bg_color=>"FF000000", :fg_color=>"FFFFFFFF", :sz=>13, :alignment=>{:horizontal=>:left}, :border=>{:style => :thin, :color => "FFFF0000"}, :hidden=>true, :locked=>true, :type => :dxf assert_equal(1, style, "returns the second dxfId") end + + def test_valid_document_with_font_options + font_options = { + :fg_color => "FF050505", + :sz => 20, + :b => 1, + :i => 1, + :u => :single, + :strike => 1, + :outline => 1, + :shadow => 1, + :charset => 9, + :family => 1, + :font_name => "woot font" + } + @styles.add_style font_options + + schema = Nokogiri::XML::Schema(File.open(Axlsx::SML_XSD)) + doc = Nokogiri::XML(@styles.to_xml_string) + errors = [] + schema.validate(doc).each do |error| + errors.push error + puts error.message + end + assert(errors.size == 0) + end end |
