diff options
Diffstat (limited to 'test/stylesheet')
| -rw-r--r-- | test/stylesheet/tc_gradient_fill.rb | 8 | ||||
| -rw-r--r-- | test/stylesheet/tc_pattern_fill.rb | 8 |
2 files changed, 15 insertions, 1 deletions
diff --git a/test/stylesheet/tc_gradient_fill.rb b/test/stylesheet/tc_gradient_fill.rb index c252a498..546941d7 100644 --- a/test/stylesheet/tc_gradient_fill.rb +++ b/test/stylesheet/tc_gradient_fill.rb @@ -61,4 +61,12 @@ class TestGradientFill < Test::Unit::TestCase assert(@item.stop.size == 1) assert(@item.stop.last.is_a?(Axlsx::GradientStop)) end + + def test_to_xml_string + @item.stop << Axlsx::GradientStop.new(Axlsx::Color.new(:rgb => "000000"), 0.5) + @item.stop << Axlsx::GradientStop.new(Axlsx::Color.new(:rgb => "FFFFFF"), 0.5) + @item.type = :path + doc = Nokogiri::XML(@item.to_xml_string) + assert(doc.xpath("//color[@rgb='FF000000']")) + end end diff --git a/test/stylesheet/tc_pattern_fill.rb b/test/stylesheet/tc_pattern_fill.rb index 65ed0dd1..3895cffb 100644 --- a/test/stylesheet/tc_pattern_fill.rb +++ b/test/stylesheet/tc_pattern_fill.rb @@ -33,5 +33,11 @@ class TestPatternFill < Test::Unit::TestCase assert_nothing_raised { @item.patternType = :lightUp } assert_equal(@item.patternType, :lightUp) end - + + def test_to_xml_string + @item = Axlsx::PatternFill.new :bgColor => Axlsx::Color.new(:rgb => "FF0000"), :fgColor => Axlsx::Color.new(:rgb=>"00FF00") + doc = Nokogiri::XML(@item.to_xml_string) + assert(doc.xpath('//color[@rgb="FFFF0000"]')) + assert(doc.xpath('//color[@rgb="FF00FF00"]')) + end end |
