summaryrefslogtreecommitdiffhomepage
path: root/test/workbook/worksheet/tc_icon_set.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/workbook/worksheet/tc_icon_set.rb
parente81036b76e734ab03fac31faafb9732f6b3b2928 (diff)
downloadcaxlsx-350f7ae9a04f3d39c099cc54f7c04bf31f385d96.tar.gz
caxlsx-350f7ae9a04f3d39c099cc54f7c04bf31f385d96.zip
Add RuboCop Minitest
Diffstat (limited to 'test/workbook/worksheet/tc_icon_set.rb')
-rw-r--r--test/workbook/worksheet/tc_icon_set.rb21
1 files changed, 11 insertions, 10 deletions
diff --git a/test/workbook/worksheet/tc_icon_set.rb b/test/workbook/worksheet/tc_icon_set.rb
index 3a4079bf..3a52cb98 100644
--- a/test/workbook/worksheet/tc_icon_set.rb
+++ b/test/workbook/worksheet/tc_icon_set.rb
@@ -6,39 +6,40 @@ class TestIconSet < Test::Unit::TestCase
end
def test_defaults
- assert_equal @icon_set.iconSet, "3TrafficLights1"
- assert_equal @icon_set.percent, true
- assert_equal @icon_set.reverse, false
- assert_equal @icon_set.showValue, true
+ assert_equal("3TrafficLights1", @icon_set.iconSet)
+ assert(@icon_set.percent)
+ refute(@icon_set.reverse)
+ assert(@icon_set.showValue)
end
def test_icon_set
assert_raise(ArgumentError) { @icon_set.iconSet = "invalid_value" }
assert_nothing_raised { @icon_set.iconSet = "5Rating" }
- assert_equal(@icon_set.iconSet, "5Rating")
+ assert_equal("5Rating", @icon_set.iconSet)
end
def test_percent
assert_raise(ArgumentError) { @icon_set.percent = :invalid_type }
assert_nothing_raised { @icon_set.percent = false }
- assert_equal(@icon_set.percent, false)
+ refute(@icon_set.percent)
end
def test_showValue
assert_raise(ArgumentError) { @icon_set.showValue = :invalid_type }
assert_nothing_raised { @icon_set.showValue = false }
- assert_equal(@icon_set.showValue, false)
+ refute(@icon_set.showValue)
end
def test_reverse
assert_raise(ArgumentError) { @icon_set.reverse = :invalid_type }
assert_nothing_raised { @icon_set.reverse = false }
- assert_equal(@icon_set.reverse, false)
+ refute(@icon_set.reverse)
end
def test_to_xml_string
doc = Nokogiri::XML.parse(@icon_set.to_xml_string)
- assert_equal(doc.xpath(".//iconSet[@iconSet='3TrafficLights1'][@percent=1][@reverse=0][@showValue=1]").size, 1)
- assert_equal(doc.xpath(".//iconSet//cfvo").size, 3)
+
+ assert_equal(1, doc.xpath(".//iconSet[@iconSet='3TrafficLights1'][@percent=1][@reverse=0][@showValue=1]").size)
+ assert_equal(3, doc.xpath(".//iconSet//cfvo").size)
end
end