Sha256: fe493caf087fabd497dbcacb8fd79065df232fe758e201ed2ab819d4ba4b6567
Contents?: true
Size: 1.2 KB
Versions: 4
Compression:
Stored size: 1.2 KB
Contents
require 'tc_helper.rb' class TestPieSeries < Test::Unit::TestCase def setup p = Axlsx::Package.new @ws = p.workbook.add_worksheet :name=>"hmmm" chart = @ws.add_chart Axlsx::Pie3DChart, :title => "fishery" @series = chart.add_series :data=>[0,1,2], :labels=>["zero", "one", "two"], :title=>"bob", :colors => ["FF0000", "00FF00", "0000FF"] end def test_initialize assert_equal(@series.title.text, "bob", "series title has been applied") assert_equal(@series.labels.class, Axlsx::AxDataSource) assert_equal(@series.data.class, Axlsx::NumDataSource) assert_equal(@series.explosion, nil, "series shape has been applied") end def test_explosion 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 end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
caxlsx-3.1.1 | test/drawing/tc_pie_series.rb |
caxlsx-3.1.0 | test/drawing/tc_pie_series.rb |
caxlsx-3.0.4 | test/drawing/tc_pie_series.rb |
caxlsx-3.0.3 | test/drawing/tc_pie_series.rb |