Sha256: d2fe972a2df08132189b59ae3f65f184247bd871615dfa9b295dd4d2742f2ba1

Contents?: true

Size: 793 Bytes

Versions: 7

Compression:

Stored size: 793 Bytes

Contents

require 'test/unit'
require 'axlsx.rb'

class TestTableStyles < Test::Unit::TestCase

  def setup
    @item = Axlsx::TableStyleElement.new
  end

  def teardown
  end

  def test_initialiation
    assert_equal(@item.type, nil)
    assert_equal(@item.size, nil)
    assert_equal(@item.dxfId, nil)
  end

  def test_type    
    assert_raise(ArgumentError) { @item.type = -1.1 }
    assert_nothing_raised { @item.type = :blankRow }
    assert_equal(@item.type, :blankRow)
  end

  def test_size
    assert_raise(ArgumentError) { @item.size = -1.1 }
    assert_nothing_raised { @item.size = 2 }
    assert_equal(@item.size, 2)
  end

  def test_dxfId
    assert_raise(ArgumentError) { @item.dxfId = -1.1 }
    assert_nothing_raised { @item.dxfId = 7 }
    assert_equal(@item.dxfId, 7)
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
axlsx-1.0.7 test/stylesheet/tc_table_styles.rb~
axlsx-1.0.6 test/stylesheet/tc_table_styles.rb~
axlsx-1.0.5 test/stylesheet/tc_table_styles.rb~
axlsx-1.0.4 test/stylesheet/tc_table_styles.rb~
axlsx-1.0.3 test/stylesheet/tc_table_styles.rb~
axlsx-1.0.1 test/stylesheet/tc_table_styles.rb~
axlsx-1.0.0 test/stylesheet/tc_table_styles.rb~