From 9c380e51a52e2d791767c3a488256619a0c57cd8 Mon Sep 17 00:00:00 2001 From: Noel Peden Date: Mon, 24 Aug 2020 15:34:30 -0700 Subject: Explosion explosion fixed - issue 58 --- lib/axlsx/drawing/pie_series.rb | 2 +- test/drawing/tc_pie_series.rb | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/axlsx/drawing/pie_series.rb b/lib/axlsx/drawing/pie_series.rb index 31a6b265..fd18ed6a 100644 --- a/lib/axlsx/drawing/pie_series.rb +++ b/lib/axlsx/drawing/pie_series.rb @@ -47,7 +47,7 @@ module Axlsx # @return [String] def to_xml_string(str = '') super(str) do - str << '' unless @explosion.nil? + str << '' unless @explosion.nil? colors.each_with_index do |c, index| str << '' str << ('') diff --git a/test/drawing/tc_pie_series.rb b/test/drawing/tc_pie_series.rb index 70abb602..18e4bbd0 100644 --- a/test/drawing/tc_pie_series.rb +++ b/test/drawing/tc_pie_series.rb @@ -20,12 +20,13 @@ class TestPieSeries < Test::Unit::TestCase assert_raise(ArgumentError, "require valid explosion") { @series.explosion = :lots } assert_nothing_raised("allow valid explosion") { @series.explosion = 20 } assert(@series.explosion == 20) + # issue 58 - explosion caused to_xml_string to fail - now tested + assert_nothing_raised("allow to_xml_string") { @series.to_xml_string } end def test_to_xml_string doc = Nokogiri::XML(@series.to_xml_string) assert(doc.xpath("//srgbClr[@val='#{@series.colors[0]}']")) - end #TODO test unique serialization parts -- cgit v1.2.3