summaryrefslogtreecommitdiffhomepage
path: root/test/stylesheet/tc_table_style.rb
diff options
context:
space:
mode:
authorGeremia Taglialatela <[email protected]>2023-04-13 13:13:34 +0200
committerGeremia Taglialatela <[email protected]>2023-05-03 16:05:17 +0200
commit350f7ae9a04f3d39c099cc54f7c04bf31f385d96 (patch)
treee84af2a70d3b18a0b94c784338faf48215c9c8a8 /test/stylesheet/tc_table_style.rb
parente81036b76e734ab03fac31faafb9732f6b3b2928 (diff)
downloadcaxlsx-350f7ae9a04f3d39c099cc54f7c04bf31f385d96.tar.gz
caxlsx-350f7ae9a04f3d39c099cc54f7c04bf31f385d96.zip
Add RuboCop Minitest
Diffstat (limited to 'test/stylesheet/tc_table_style.rb')
-rw-r--r--test/stylesheet/tc_table_style.rb20
1 files changed, 11 insertions, 9 deletions
diff --git a/test/stylesheet/tc_table_style.rb b/test/stylesheet/tc_table_style.rb
index a003c37a..6c15ebae 100644
--- a/test/stylesheet/tc_table_style.rb
+++ b/test/stylesheet/tc_table_style.rb
@@ -8,35 +8,37 @@ class TestTableStyle < Test::Unit::TestCase
def teardown; end
def test_initialiation
- assert_equal(@item.name, "fisher")
- assert_equal(@item.pivot, nil)
- assert_equal(@item.table, nil)
+ assert_equal("fisher", @item.name)
+ assert_nil(@item.pivot)
+ assert_nil(@item.table)
ts = Axlsx::TableStyle.new 'price', :pivot => true, :table => true
- assert_equal(ts.name, 'price')
- assert_equal(ts.pivot, true)
- assert_equal(ts.table, true)
+
+ assert_equal('price', ts.name)
+ assert(ts.pivot)
+ assert(ts.table)
end
def test_name
assert_raise(ArgumentError) { @item.name = -1.1 }
assert_nothing_raised { @item.name = "lovely table style" }
- assert_equal(@item.name, "lovely table style")
+ assert_equal("lovely table style", @item.name)
end
def test_pivot
assert_raise(ArgumentError) { @item.pivot = -1.1 }
assert_nothing_raised { @item.pivot = true }
- assert_equal(@item.pivot, true)
+ assert(@item.pivot)
end
def test_table
assert_raise(ArgumentError) { @item.table = -1.1 }
assert_nothing_raised { @item.table = true }
- assert_equal(@item.table, true)
+ assert(@item.table)
end
def test_to_xml_string
doc = Nokogiri::XML(@item.to_xml_string)
+
assert(doc.xpath("//tableStyle[@name='#{@item.name}']"))
end
end