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_pattern_fill.rb | |
| parent | e81036b76e734ab03fac31faafb9732f6b3b2928 (diff) | |
| download | caxlsx-350f7ae9a04f3d39c099cc54f7c04bf31f385d96.tar.gz caxlsx-350f7ae9a04f3d39c099cc54f7c04bf31f385d96.zip | |
Add RuboCop Minitest
Diffstat (limited to 'test/stylesheet/tc_pattern_fill.rb')
| -rw-r--r-- | test/stylesheet/tc_pattern_fill.rb | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/test/stylesheet/tc_pattern_fill.rb b/test/stylesheet/tc_pattern_fill.rb index 228d7ca2..9e122d19 100644 --- a/test/stylesheet/tc_pattern_fill.rb +++ b/test/stylesheet/tc_pattern_fill.rb @@ -8,32 +8,33 @@ class TestPatternFill < Test::Unit::TestCase def teardown; end def test_initialiation - assert_equal(@item.patternType, :none) - assert_equal(@item.bgColor, nil) - assert_equal(@item.fgColor, nil) + assert_equal(:none, @item.patternType) + assert_nil(@item.bgColor) + assert_nil(@item.fgColor) end def test_bgColor assert_raise(ArgumentError) { @item.bgColor = -1.1 } assert_nothing_raised { @item.bgColor = Axlsx::Color.new } - assert_equal(@item.bgColor.rgb, "FF000000") + assert_equal("FF000000", @item.bgColor.rgb) end def test_fgColor assert_raise(ArgumentError) { @item.fgColor = -1.1 } assert_nothing_raised { @item.fgColor = Axlsx::Color.new } - assert_equal(@item.fgColor.rgb, "FF000000") + assert_equal("FF000000", @item.fgColor.rgb) end def test_pattern_type assert_raise(ArgumentError) { @item.patternType = -1.1 } assert_nothing_raised { @item.patternType = :lightUp } - assert_equal(@item.patternType, :lightUp) + assert_equal(:lightUp, @item.patternType) end def test_to_xml_string @item = Axlsx::PatternFill.new :bgColor => Axlsx::Color.new(:rgb => "FF0000"), :fgColor => Axlsx::Color.new(:rgb => "00FF00") doc = Nokogiri::XML(@item.to_xml_string) + assert(doc.xpath('//color[@rgb="FFFF0000"]')) assert(doc.xpath('//color[@rgb="FF00FF00"]')) end |
