diff options
| author | Geremia Taglialatela <[email protected]> | 2023-04-13 13:09:14 +0200 |
|---|---|---|
| committer | Geremia Taglialatela <[email protected]> | 2023-05-03 16:05:17 +0200 |
| commit | e81036b76e734ab03fac31faafb9732f6b3b2928 (patch) | |
| tree | 4a5944faddeac7aa574a26955d41f4901fccc038 /test/util | |
| parent | 194e852d4f61d7c1acf4cd79df86bee43d84028a (diff) | |
| download | caxlsx-e81036b76e734ab03fac31faafb9732f6b3b2928.tar.gz caxlsx-e81036b76e734ab03fac31faafb9732f6b3b2928.zip | |
Fix offenses to non-production code
- Lint/AmbiguousBlockAssociation
- Lint/AmbiguousOperatorPrecedence
- Lint/EmptyBlock
- Lint/RedundantSplatExpansion
- Lint/RedundantStringCoercion
- Lint/SymbolConversion
- Lint/UnusedBlockArgument
- Style/BlockDelimiters
- Style/CommentAnnotation
- Style/EachForSimpleLoop
- Style/EmptyMethod
- Style/ExpandPathArguments
- Style/FileWrite
- Style/GlobalStdStream (UNSAFE)
- Style/HashEachMethods (UNSAFE)
- Style/NestedParenthesizedCalls
- Style/NilComparison
- Style/NumericLiteralPrefix (manually fixed)
- Style/ParallelAssignment
- Style/PreferredHashMethods (UNSAFE)
- Style/RedundantInterpolation (UNSAFE)
- Style/RedundantParentheses (UNSAFE)
- Style/RegexpLiteral
- Style/RescueStandardError
- Style/SpecialGlobalVars (UNSAFE)
- Style/SymbolProc (UNSAFE)
- Style/ZeroLengthPredicate (UNSAFE)
Diffstat (limited to 'test/util')
| -rw-r--r-- | test/util/tc_mime_type_utils.rb | 3 | ||||
| -rw-r--r-- | test/util/tc_simple_typed_list.rb | 5 | ||||
| -rw-r--r-- | test/util/tc_validators.rb | 8 |
3 files changed, 6 insertions, 10 deletions
diff --git a/test/util/tc_mime_type_utils.rb b/test/util/tc_mime_type_utils.rb index 52c49e2e..e469f31e 100644 --- a/test/util/tc_mime_type_utils.rb +++ b/test/util/tc_mime_type_utils.rb @@ -8,8 +8,7 @@ class TestMimeTypeUtils < Test::Unit::TestCase @test_img_url = "https://example.com/sample-image.png" end - def teardown - end + def teardown; end def test_mime_type_utils assert_equal(Axlsx::MimeTypeUtils::get_mime_type(@test_img), 'image/jpeg') diff --git a/test/util/tc_simple_typed_list.rb b/test/util/tc_simple_typed_list.rb index fc1ab0a2..5624b903 100644 --- a/test/util/tc_simple_typed_list.rb +++ b/test/util/tc_simple_typed_list.rb @@ -4,8 +4,7 @@ class TestSimpleTypedList < Test::Unit::TestCase @list = Axlsx::SimpleTypedList.new Integer end - def teardown - end + def teardown; end def test_type_is_a_class_or_array_of_class assert_nothing_raised { Axlsx::SimpleTypedList.new Integer } @@ -29,7 +28,7 @@ class TestSimpleTypedList < Test::Unit::TestCase end def test_concat_should_return_index - assert(@list.size == 0) + assert(@list.empty?) assert(@list << 1 == 0) assert(@list << 2 == 1) @list.delete_at 0 diff --git a/test/util/tc_validators.rb b/test/util/tc_validators.rb index 7df2e41b..58aa6b7c 100644 --- a/test/util/tc_validators.rb +++ b/test/util/tc_validators.rb @@ -1,10 +1,8 @@ require 'tc_helper.rb' class TestValidators < Test::Unit::TestCase - def setup - end + def setup; end - def teardown - end + def teardown; end def test_validators # unsigned_int @@ -20,7 +18,7 @@ class TestValidators < Test::Unit::TestCase assert_raise(ArgumentError) { Axlsx.validate_int(Array) } # boolean (as 0 or 1, :true, :false, true, false, or "true," "false") - [0, 1, :true, :false, true, false, "true", "false"].each do |v| + [0, 1, :true, :false, true, false, "true", "false"].each do |_v| assert_nothing_raised { Axlsx.validate_boolean 0 } end assert_raise(ArgumentError) { Axlsx.validate_boolean 2 } |
