summaryrefslogtreecommitdiffhomepage
path: root/test/stylesheet/tc_color.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_color.rb
parente81036b76e734ab03fac31faafb9732f6b3b2928 (diff)
downloadcaxlsx-350f7ae9a04f3d39c099cc54f7c04bf31f385d96.tar.gz
caxlsx-350f7ae9a04f3d39c099cc54f7c04bf31f385d96.zip
Add RuboCop Minitest
Diffstat (limited to 'test/stylesheet/tc_color.rb')
-rw-r--r--test/stylesheet/tc_color.rb13
1 files changed, 7 insertions, 6 deletions
diff --git a/test/stylesheet/tc_color.rb b/test/stylesheet/tc_color.rb
index 46e94f88..336c093f 100644
--- a/test/stylesheet/tc_color.rb
+++ b/test/stylesheet/tc_color.rb
@@ -8,32 +8,33 @@ class TestColor < Test::Unit::TestCase
def teardown; end
def test_initialiation
- assert_equal(@item.auto, nil)
- assert_equal(@item.rgb, "FF000000")
- assert_equal(@item.tint, nil)
+ assert_nil(@item.auto)
+ assert_equal("FF000000", @item.rgb)
+ assert_nil(@item.tint)
end
def test_auto
assert_raise(ArgumentError) { @item.auto = -1 }
assert_nothing_raised { @item.auto = true }
- assert_equal(@item.auto, true)
+ assert(@item.auto)
end
def test_rgb
assert_raise(ArgumentError) { @item.rgb = -1 }
assert_nothing_raised { @item.rgb = "FF00FF00" }
- assert_equal(@item.rgb, "FF00FF00")
+ assert_equal("FF00FF00", @item.rgb)
end
def test_rgb_writer_doesnt_mutate_its_argument
my_rgb = 'ff00ff00'
@item.rgb = my_rgb
+
assert_equal 'ff00ff00', my_rgb
end
def test_tint
assert_raise(ArgumentError) { @item.tint = -1 }
assert_nothing_raised { @item.tint = -1.0 }
- assert_equal(@item.tint, -1.0)
+ assert_in_delta(@item.tint, -1.0)
end
end