diff options
| author | Geremia Taglialatela <[email protected]> | 2023-04-13 13:13:34 +0200 |
|---|---|---|
| committer | Geremia Taglialatela <[email protected]> | 2023-05-03 16:05:17 +0200 |
| commit | 350f7ae9a04f3d39c099cc54f7c04bf31f385d96 (patch) | |
| tree | e84af2a70d3b18a0b94c784338faf48215c9c8a8 /test/stylesheet/tc_table_style_element.rb | |
| parent | e81036b76e734ab03fac31faafb9732f6b3b2928 (diff) | |
| download | caxlsx-350f7ae9a04f3d39c099cc54f7c04bf31f385d96.tar.gz caxlsx-350f7ae9a04f3d39c099cc54f7c04bf31f385d96.zip | |
Add RuboCop Minitest
Diffstat (limited to 'test/stylesheet/tc_table_style_element.rb')
| -rw-r--r-- | test/stylesheet/tc_table_style_element.rb | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/test/stylesheet/tc_table_style_element.rb b/test/stylesheet/tc_table_style_element.rb index 2b52a23d..6dcbedd9 100644 --- a/test/stylesheet/tc_table_style_element.rb +++ b/test/stylesheet/tc_table_style_element.rb @@ -8,36 +8,38 @@ class TestTableStyleElement < Test::Unit::TestCase def teardown; end def test_initialiation - assert_equal(@item.type, nil) - assert_equal(@item.size, nil) - assert_equal(@item.dxfId, nil) + assert_nil(@item.type) + assert_nil(@item.size) + assert_nil(@item.dxfId) options = { :type => :headerRow, :size => 10, :dxfId => 1 } tse = Axlsx::TableStyleElement.new options + options.each { |key, value| assert_equal(tse.send(key.to_sym), value) } end def test_type assert_raise(ArgumentError) { @item.type = -1.1 } assert_nothing_raised { @item.type = :blankRow } - assert_equal(@item.type, :blankRow) + assert_equal(:blankRow, @item.type) end def test_size assert_raise(ArgumentError) { @item.size = -1.1 } assert_nothing_raised { @item.size = 2 } - assert_equal(@item.size, 2) + assert_equal(2, @item.size) end def test_dxfId assert_raise(ArgumentError) { @item.dxfId = -1.1 } assert_nothing_raised { @item.dxfId = 7 } - assert_equal(@item.dxfId, 7) + assert_equal(7, @item.dxfId) end def test_to_xml_string doc = Nokogiri::XML(@item.to_xml_string) @item.type = :headerRow + assert(doc.xpath("//tableStyleElement[@type='#{@item.type}']")) end end |
