summaryrefslogtreecommitdiffhomepage
path: root/test/stylesheet/tc_table_style_element.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/stylesheet/tc_table_style_element.rb')
-rw-r--r--test/stylesheet/tc_table_style_element.rb14
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