Sha256: c8ca58378429728d50006f27ddc348b73308d61e1a2d6d3c4f8151fd3b1895eb
Contents?: true
Size: 825 Bytes
Versions: 14
Compression:
Stored size: 825 Bytes
Contents
require 'test/unit' require 'axlsx.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
14 entries across 14 versions & 1 rubygems