Skip to content

Commit

Permalink
Suppress a RuboCop offense
Browse files Browse the repository at this point in the history
This PR suppresses the following RuboCop offense.

```console
% bundle exec rubocop
(snip)

Offenses:

spec/spec_helper.rb:12:4: C: [Correctable] Style/FetchEnvVar: Use
ENV.fetch('COVERAGE') or ENV.fetch('COVERAGE', nil) instead of ENV['COVERAGE'].
if ENV['COVERAGE'] == 'true'
   ^^^^^^^^^^^^^^^

251 files inspected, 1 offense detected, 1 offense auto-correctable
RuboCop failed!
```
  • Loading branch information
koic committed Apr 19, 2022
1 parent e816cf1 commit 944394b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# in ./support/ and its subdirectories.
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].sort.each { |f| require f }

if ENV['COVERAGE'] == 'true'
if ENV.fetch('COVERAGE', nil) == 'true'
require 'simplecov'
SimpleCov.start
end
Expand Down

0 comments on commit 944394b

Please sign in to comment.