summaryrefslogtreecommitdiffhomepage
path: root/test/util
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/util
parente81036b76e734ab03fac31faafb9732f6b3b2928 (diff)
downloadcaxlsx-350f7ae9a04f3d39c099cc54f7c04bf31f385d96.tar.gz
caxlsx-350f7ae9a04f3d39c099cc54f7c04bf31f385d96.zip
Add RuboCop Minitest
Diffstat (limited to 'test/util')
-rw-r--r--test/util/tc_mime_type_utils.rb4
-rw-r--r--test/util/tc_serialized_attributes.rb1
-rw-r--r--test/util/tc_simple_typed_list.rb29
3 files changed, 20 insertions, 14 deletions
diff --git a/test/util/tc_mime_type_utils.rb b/test/util/tc_mime_type_utils.rb
index e469f31e..796c8f3a 100644
--- a/test/util/tc_mime_type_utils.rb
+++ b/test/util/tc_mime_type_utils.rb
@@ -11,7 +11,7 @@ class TestMimeTypeUtils < Test::Unit::TestCase
def teardown; end
def test_mime_type_utils
- assert_equal(Axlsx::MimeTypeUtils::get_mime_type(@test_img), 'image/jpeg')
- assert_equal(Axlsx::MimeTypeUtils::get_mime_type_from_uri(@test_img_url), 'image/png')
+ assert_equal('image/jpeg', Axlsx::MimeTypeUtils::get_mime_type(@test_img))
+ assert_equal('image/png', Axlsx::MimeTypeUtils::get_mime_type_from_uri(@test_img_url))
end
end
diff --git a/test/util/tc_serialized_attributes.rb b/test/util/tc_serialized_attributes.rb
index 88c7536d..886bafde 100644
--- a/test/util/tc_serialized_attributes.rb
+++ b/test/util/tc_serialized_attributes.rb
@@ -14,6 +14,7 @@ class TestSeralizedAttributes < Test::Unit::TestCase
def test_camel_symbol
@object.camel_symbol = :foo_bar
+
assert_equal('camelSymbol="fooBar" ', @object.serialized_attributes)
end
end
diff --git a/test/util/tc_simple_typed_list.rb b/test/util/tc_simple_typed_list.rb
index 5624b903..651764e1 100644
--- a/test/util/tc_simple_typed_list.rb
+++ b/test/util/tc_simple_typed_list.rb
@@ -28,20 +28,22 @@ class TestSimpleTypedList < Test::Unit::TestCase
end
def test_concat_should_return_index
- assert(@list.empty?)
- assert(@list << 1 == 0)
- assert(@list << 2 == 1)
+ assert_empty(@list)
+ assert_equal(0, @list << 1)
+ assert_equal(1, @list << 2)
@list.delete_at 0
- assert(@list << 3 == 1)
- assert(@list.index(2) == 0)
+
+ assert_equal(1, @list << 3)
+ assert_equal(0, @list.index(2))
end
def test_push_should_return_index
- assert(@list.push(1) == 0)
- assert(@list.push(2) == 1)
+ assert_equal(0, @list.push(1))
+ assert_equal(1, @list.push(2))
@list.delete_at 0
- assert(@list.push(3) == 1)
- assert(@list.index(2) == 0)
+
+ assert_equal(1, @list.push(3))
+ assert_equal(0, @list.index(2))
end
def test_locking
@@ -63,14 +65,17 @@ class TestSimpleTypedList < Test::Unit::TestCase
def test_delete
@list.push 1
- assert(@list.size == 1)
+
+ assert_equal(1, @list.size)
@list.delete 1
- assert(@list.empty?)
+
+ assert_empty(@list)
end
def test_equality
@list.push 1
@list.push 2
- assert_equal(@list.to_ary, [1, 2])
+
+ assert_equal([1, 2], @list.to_ary)
end
end