Sha256: f9028253e00222672dfa3e85b2a55db14f1941f118c262983c590fdc3b1fdc16

Contents?: true

Size: 1018 Bytes

Versions: 4

Compression:

Stored size: 1018 Bytes

Contents

require 'tc_helper.rb'

class TestBarSeries < Test::Unit::TestCase

  def setup
    p = Axlsx::Package.new
    @ws = p.workbook.add_worksheet :name=>"hmmm"
    chart = @ws.drawing.add_chart Axlsx::Bar3DChart, :title => "fishery"
    @series = chart.add_series :data=>[0,1,2], :labels=>["zero", "one", "two"], :title=>"bob"
  end

  def test_initialize
    assert_equal(@series.title.text, "bob", "series title has been applied")
    assert_equal(@series.data, [0,1,2], "data option applied")
    assert_equal(@series.labels, ["zero", "one","two"], "labels option applied")
    assert_equal(@series.shape, :box, "series shape has been applied")
  end

  def test_data
    assert_equal(@series.data, [0,1,2])
  end

  def test_labels
    assert_equal(@series.labels, ["zero", "one", "two"])
  end

  def test_shape
    assert_raise(ArgumentError, "require valid shape") { @series.shape = :teardropt }
    assert_nothing_raised("allow valid shape") { @series.shape = :cone }
    assert(@series.shape == :cone)
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
axlsx-1.1.3 test/drawing/tc_bar_series.rb
axlsx-1.1.2 test/drawing/tc_bar_series.rb
axlsx-1.1.1 test/drawing/tc_bar_series.rb
axlsx-1.1.0 test/drawing/tc_bar_series.rb