Skip to content

Commit

Permalink
Use RuboCop RSpec 2.29
Browse files Browse the repository at this point in the history
This PR uses RuboCop RSpec 2.29 and suppress the following offenses:

```console
$ bundle exec rubocop
(snip)

Offenses:

spec/rubocop/config_loader_spec.rb:1016:74: C: [Correctable] RSpec/EmptyOutput: Use not_to instead of matching on an empty output.
        expect { expect(configuration_from_file.to_h).to eq(config) }.to output('').to_stderr
                                                                         ^^^^^^^^^^
spec/rubocop/config_loader_spec.rb:1213:18: C: [Correctable] RSpec/EmptyOutput: Use not_to instead of matching on an empty output.
          end.to output('').to_stderr
                 ^^^^^^^^^^
spec/rubocop/config_loader_spec.rb:1249:18: C: [Correctable] RSpec/EmptyOutput: Use not_to instead of matching on an empty output.
          end.to output('').to_stderr
                 ^^^^^^^^^^
spec/rubocop/config_loader_spec.rb:1317:47: C: [Correctable] RSpec/EmptyOutput: Use not_to instead of matching on an empty output.
        expect { configuration_from_file }.to output('').to_stderr
                                              ^^^^^^^^^^

1534 files inspected, 4 offenses detected, 4 offenses autocorrectable
```
  • Loading branch information
koic committed Apr 5, 2024
1 parent b370532 commit 8511384
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ gem 'rake', '~> 13.0'
gem 'rspec', '~> 3.7'
gem 'rubocop-performance', '~> 1.21.0'
gem 'rubocop-rake', '~> 0.6.0'
gem 'rubocop-rspec', '~> 2.28.0'
gem 'rubocop-rspec', '~> 2.29.1'
# Workaround for cc-test-reporter with SimpleCov 0.18.
# Stop upgrading SimpleCov until the following issue will be resolved.
# https://github.com/codeclimate/test-reporter/issues/418
Expand Down
8 changes: 4 additions & 4 deletions spec/rubocop/config_loader_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1013,7 +1013,7 @@ class Loop < Base
'AllowedPatterns' => []
}
)
expect { expect(configuration_from_file.to_h).to eq(config) }.to output('').to_stderr
expect { expect(configuration_from_file.to_h).to eq(config) }.not_to output.to_stderr
end
end

Expand Down Expand Up @@ -1210,7 +1210,7 @@ class Loop < Base
expect do
expect(configuration_from_file['Metrics/MethodLength']
.to_set.superset?(expected.to_set)).to be(true)
end.to output('').to_stderr
end.not_to output.to_stderr

expected = { 'Enabled' => true, # gemtwo/config/default.yml
'Max' => 72, # gemtwo/config/strict.yml
Expand Down Expand Up @@ -1246,7 +1246,7 @@ class Loop < Base
expect do
expect(configuration_from_file['Metrics/MethodLength']
.to_set.superset?(expected.to_set)).to be(true)
end.to output('').to_stderr
end.not_to output.to_stderr

expected = { 'Enabled' => true, # gemtwo/config/default.yml
'Max' => 72, # gemtwo/config/strict.yml
Expand Down Expand Up @@ -1314,7 +1314,7 @@ class Loop < Base
end

it 'creates the cached file alongside the owning file' do
expect { configuration_from_file }.to output('').to_stderr
expect { configuration_from_file }.not_to output.to_stderr
expect(File.exist?(cache_file)).to be true
end
end
Expand Down

0 comments on commit 8511384

Please sign in to comment.