Sha256: 90a84dc59d7f91306a25b1b9a3b8c1349c302ca08379824f8125d7a77bcd4c72

Contents?: true

Size: 799 Bytes

Versions: 33

Compression:

Stored size: 799 Bytes

Contents

require 'tc_helper.rb'

class TestSeriesTitle < Test::Unit::TestCase
  def setup
    @p = Axlsx::Package.new
    ws = @p.workbook.add_worksheet
    @row = ws.add_row ["one", 1, Time.now]
    @title = Axlsx::SeriesTitle.new
    @chart = ws.add_chart Axlsx::Bar3DChart
  end

  def teardown
  end

  def test_initialization
    assert(@title.text == "")
    assert(@title.cell == nil)
  end

  def test_text
    assert_raise(ArgumentError, "text must be a string") { @title.text = 123 }
    @title.cell = @row.cells.first
    @title.text = "bob"
    assert(@title.cell == nil, "setting title with text clears the cell")
  end

  def test_cell
    assert_raise(ArgumentError, "cell must be a Cell") { @title.cell = "123" }
    @title.cell = @row.cells.first
    assert(@title.text == "one")
  end

end

Version data entries

33 entries across 33 versions & 6 rubygems

Version Path
bonio-axlsx-2.2.3 test/drawing/tc_series_title.rb
caxlsx-2.0.2 test/drawing/tc_series_title.rb
caxlsx-3.0.1 test/drawing/tc_series_title.rb
caxlsx-3.0.0 test/drawing/tc_series_title.rb
axlsx-alt-3.0.1 test/drawing/tc_series_title.rb
axlsx-alt-3.0.0 test/drawing/tc_series_title.rb
axlsx-3.0.0.pre test/drawing/tc_series_title.rb
bonio-axlsx-2.2.2 test/drawing/tc_series_title.rb
bonio-axlsx-2.2.1 test/drawing/tc_series_title.rb
dg-axlsx-2.1.0 test/drawing/tc_series_title.rb
axlsx-2.1.0.pre test/drawing/tc_series_title.rb
l_axlsx-2.0.1 test/drawing/tc_series_title.rb
axlsx-2.0.1 test/drawing/tc_series_title.rb
axlsx-2.0.0 test/drawing/tc_series_title.rb
axlsx-1.3.6 test/drawing/tc_series_title.rb
axlsx-1.3.5 test/drawing/tc_series_title.rb
axlsx-1.3.4 test/drawing/tc_series_title.rb
axlsx-1.3.3 test/drawing/tc_series_title.rb
axlsx-1.3.2 test/drawing/tc_series_title.rb
axlsx-1.3.1 test/drawing/tc_series_title.rb