Skip to content

Commit

Permalink
Remove redundant expect_no_offenses keyword arguments
Browse files Browse the repository at this point in the history
This PR removes the following redundant `expect_no_offenses` keyword arguments:

```console
$ bundle exec rubocop
(snip)

Offenses:

spec/rubocop/cop/performance/redundant_equality_comparison_block_spec.rb:52:35:
C: [Correctable] InternalAffairs/RedundantExpectOffenseArguments: Remove the redundant arguments.
        expect_no_offenses(<<~RUBY, method_name: method_name)
                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/rubocop/cop/performance/sum_spec.rb:329:33:
C: [Correctable] InternalAffairs/RedundantExpectOffenseArguments: Remove the redundant arguments.
      expect_no_offenses(<<~RUBY, method: method)
                                ^^^^^^^^^^^^^^^^
spec/rubocop/cop/performance/sum_spec.rb:348:35:
C: [Correctable] InternalAffairs/RedundantExpectOffenseArguments: Remove the redundant arguments.
        expect_no_offenses(<<~RUBY, method: method)
                                  ^^^^^^^^^^^^^^^^
spec/rubocop/cop/performance/times_map_spec.rb:52:37:
C: [Correctable] InternalAffairs/RedundantExpectOffenseArguments: Remove the redundant arguments.
          expect_no_offenses(<<~RUBY, method: method)
                                    ^^^^^^^^^^^^^^^^
spec/rubocop/cop/performance/times_map_spec.rb:60:37:
C: [Correctable] InternalAffairs/RedundantExpectOffenseArguments: Remove the redundant arguments.
          expect_no_offenses(<<~RUBY, method: method)
                                    ^^^^^^^^^^^^^^^^
spec/rubocop/cop/performance/times_map_spec.rb:68:37:
C: [Correctable] InternalAffairs/RedundantExpectOffenseArguments: Remove the redundant arguments.
          expect_no_offenses(<<~RUBY, method: method)
                                    ^^^^^^^^^^^^^^^^

118 files inspected, 6 offenses detected, 6 offenses autocorrectable
```
  • Loading branch information
koic committed Feb 14, 2024
1 parent ae0a3d4 commit dd698b2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Expand Up @@ -49,7 +49,7 @@

it "does not register an offense when using `#{method_name}` with `===` comparison block and" \
'block argument is not used as a receiver for `===`' do
expect_no_offenses(<<~RUBY, method_name: method_name)
expect_no_offenses(<<~RUBY)
items.#{method_name} { |item| item === pattern }
RUBY
end
Expand Down
4 changes: 2 additions & 2 deletions spec/rubocop/cop/performance/sum_spec.rb
Expand Up @@ -326,7 +326,7 @@
end

it 'does not register an offense when the array is empty' do
expect_no_offenses(<<~RUBY, method: method)
expect_no_offenses(<<~RUBY)
[].#{method}(:+)
RUBY
end
Expand All @@ -345,7 +345,7 @@

context 'when Ruby 2.3 or lower', :ruby23 do
it "does not register an offense when using `array.#{method}(10, :+)`" do
expect_no_offenses(<<~RUBY, method: method)
expect_no_offenses(<<~RUBY)
array.#{method}(10, :+)
RUBY
end
Expand Down
6 changes: 3 additions & 3 deletions spec/rubocop/cop/performance/times_map_spec.rb
Expand Up @@ -49,23 +49,23 @@

context 'with a block with safe navigation call for nil literal' do
it 'does not register an offense' do
expect_no_offenses(<<~RUBY, method: method)
expect_no_offenses(<<~RUBY)
nil&.times&.#{method} { |i| i.to_s }
RUBY
end
end

context 'with a block with safe navigation call for local variable' do
it 'does not register an offense' do
expect_no_offenses(<<~RUBY, method: method)
expect_no_offenses(<<~RUBY)
nullable&.times&.#{method} { |i| i.to_s }
RUBY
end
end

context 'with a block with safe navigation call for instance variable' do
it 'does not register an offense' do
expect_no_offenses(<<~RUBY, method: method)
expect_no_offenses(<<~RUBY)
@nullable&.times&.#{method} { |i| i.to_s }
RUBY
end
Expand Down

0 comments on commit dd698b2

Please sign in to comment.