You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
rubocop -a
Inspecting 2 files
.W
Offenses:
spec/controllers/my_controller_spec.rb:4:51: W: [Corrected] Lint/UnusedBlockArgument: Unused block argument - args. You can omit the argument if you don't care about it.
[{ format: :json }, { format: :html }].each do |args|
^^^^
spec/controllers/my_controller_spec.rb:6:7: C: [Corrected] Rails/HttpPositionalArguments: Use keyword arguments instead of positional arguments for http call: get.
get :nothing, **args
^^^
spec/controllers/my_controller_spec.rb:6:30: C: [Corrected] Layout/ExtraSpacing: Unnecessary spacing detected.
get :nothing, params: { }
^
spec/controllers/my_controller_spec.rb:6:30: C: [Corrected] Layout/SpaceInsideHashLiteralBraces: Space inside empty hash literal braces detected.
get :nothing, params: { }
^^
This results in the diff:
diff --git a/spec/controllers/my_controller_spec.rb b/spec/controllers/my_controller_spec.rb
index 2e9bbe4..b8e47ac 100644
--- a/spec/controllers/my_controller_spec.rb+++ b/spec/controllers/my_controller_spec.rb@@ -1,9 +1,9 @@
# frozen_string_literal: true
describe do
- [{ format: :json }, { format: :html }].each do |args|+ [{ format: :json }, { format: :html }].each do |_args|
it do
- get :nothing, **args+ get :nothing, params: {}
end
end
end
Expected behavior
There would be no change to the code.
Actual behavior
The code is corrected in an incompatible manner
Steps to reproduce the problem
Gemfile
.rubocop.yml
spec/controllers/my_controller_spec.rb
Run rubocop:
This results in the diff:
RuboCop version
The text was updated successfully, but these errors were encountered: