Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix an incorrect autocorrect for
Style/RedundantDoubleSplatHashBraces
This PR fixes the following incorrect autocorrect for `Style/RedundantDoubleSplatHashBraces` when using double splat hash braces with `merge` method call twice. ```console $ bundle exec rspec spec/rubocop/cop/style/redundant_double_splat_hash_braces_spec.rb:82 Run options: include {:locations=>{"./spec/rubocop/cop/style/redundant_double_splat_hash_braces_spec.rb"=>[82]}} (snip) Failures: 1) RuboCop::Cop::Style::RedundantDoubleSplatHashBraces registers an offense when using double splat hash braces with `merge` method call twice Failure/Error: expect(new_source).to eq(correction) expected: "do_something(foo: bar, **options)\ndo_something(baz: qux, **options)\n" got: "do_something(foo: bar, **options)\ndo_something(baz: qux.merge(options))\n" (compared using ==) Diff: @@ -1,3 +1,3 @@ do_something(foo: bar, **options) -do_something(baz: qux, **options) +do_something(baz: qux.merge(options)) # ./lib/rubocop/rspec/expect_offense.rb:164:in `expect_correction' # ./spec/rubocop/cop/style/redundant_double_splat_hash_braces_spec.rb:90:in `block (2 levels) in <top (required)>' Finished in 0.15475 seconds (files took 1.24 seconds to load) 1 example, 1 failure ```
- Loading branch information