From e8d3b693b3dfaef80a2047afe2a955f1f376f43a Mon Sep 17 00:00:00 2001 From: Stefan Date: Wed, 1 Jun 2022 10:06:40 +0200 Subject: Implement “rounded corners” setting for charts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Until now this setting was not present in the generated XML. According to the ECMA spec the setting defaults to true, so charts always had rounded corners. Now rounded corners can be disabled explicitly. --- test/drawing/tc_chart.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'test/drawing') diff --git a/test/drawing/tc_chart.rb b/test/drawing/tc_chart.rb index c3392f26..65d7877c 100644 --- a/test/drawing/tc_chart.rb +++ b/test/drawing/tc_chart.rb @@ -120,6 +120,13 @@ class TestChart < Test::Unit::TestCase assert_raise(ArgumentError) { @chart.plot_visible_only = "" } end + def test_rounded_corners + assert(@chart.rounded_corners, "default should be true") + @chart.rounded_corners = false + assert_false(@chart.rounded_corners) + assert_raise(ArgumentError) { @chart.rounded_corners = "" } + end + def test_to_xml_string schema = Nokogiri::XML::Schema(File.open(Axlsx::DRAWING_XSD)) doc = Nokogiri::XML(@chart.to_xml_string) @@ -148,4 +155,10 @@ class TestChart < Test::Unit::TestCase @chart.plot_visible_only = false assert_equal("false", Nokogiri::XML(@chart.to_xml_string).xpath("//c:plotVisOnly").attr("val").value) end + + def test_to_xml_string_for_rounded_corners + assert_equal("true", Nokogiri::XML(@chart.to_xml_string).xpath("//c:roundedCorners").attr("val").value) + @chart.rounded_corners = false + assert_equal("false", Nokogiri::XML(@chart.to_xml_string).xpath("//c:roundedCorners").attr("val").value) + end end -- cgit v1.2.3