Skip to content

Commit

Permalink
Fix a build error
Browse files Browse the repository at this point in the history
Follow up rubocop/rubocop#11163.

This commit fixes the following build error:

```console
% bundle exec rspec spec/rubocop/cli/autocorrect_spec.rb
(snip)

Failures:

  1) RuboCop::CLI --autocorrect corrects `Style/HashExcept` with `TargetRubyVersion: 2.0`
     Got 2 failures from failure aggregation block.
     # ./spec/support/cli_spec_behavior.rb:25:in `block (2 levels) in <top (required)>'

     1.1) Failure/Error: expect(cli.run(['-a', '--only', 'Style/HashExcept'])).to eq(0)

            expected: 0
                 got: 1

            (compared using ==)
          # ./spec/rubocop/cli/autocorrect_spec.rb:54:in `block (2 levels) in <top (required)>'

     1.2) Failure/Error:
            expect(File.read('example.rb')).to eq(<<~RUBY)
              {foo: 1, bar: 2, baz: 3}.except(:bar)
            RUBY

            expected: "{foo: 1, bar: 2, baz: 3}.except(:bar)\n"
                 got: "{foo: 1, bar: 2, baz: 3}.reject {|k, v| k == :bar }\n"

            (compared using ==)

            Diff:
            @@ -1 +1 @@
            -{foo: 1, bar: 2, baz: 3}.except(:bar)
            +{foo: 1, bar: 2, baz: 3}.reject {|k, v| k == :bar }

          # ./spec/rubocop/cli/autocorrect_spec.rb:55:in `block (2 levels) in <top (required)>'

Finished in 0.28529 seconds (files took 1.12 seconds to load)
3 examples, 1 failure
```
  • Loading branch information
koic committed Nov 8, 2022
1 parent 0189504 commit 62ad3ad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion spec/rubocop/cli/autocorrect_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
{foo: 1, bar: 2, baz: 3}.reject {|k, v| k == :bar }
RUBY

expect(cli.run(['-a', '--only', 'Style/HashExcept'])).to eq(0)
expect(cli.run(['-A', '--only', 'Style/HashExcept'])).to eq(0)
expect(File.read('example.rb')).to eq(<<~RUBY)
{foo: 1, bar: 2, baz: 3}.except(:bar)
RUBY
Expand Down

0 comments on commit 62ad3ad

Please sign in to comment.