Skip to content

Commit

Permalink
Suppress warning: constant Net::HTTPServerException is deprecated
Browse files Browse the repository at this point in the history
This PR suppresses the following warning when Ruby 2.6 or higher.

```console
% ruby -v
ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x86_64-darwin19]
% RUBYOPT=-w be rspec spec/rubocop/remote_config_spec.rb
(snip)

Randomized with seed 52290
/Users/koic/src/github.com/rubocop/rubocop/spec/rubocop/remote_config_spec.rb:80:
warning: constant Net::HTTPServerException is deprecated
/Users/koic/src/github.com/rubocop/rubocop/spec/rubocop/remote_config_spec.rb:125:
warning: constant Net::HTTPServerException is deprecated
```
  • Loading branch information
koic committed Oct 21, 2021
1 parent a319d09 commit 1d5621d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions spec/rubocop/remote_config_spec.rb
Expand Up @@ -75,9 +75,11 @@
end

it 'raises error' do
exception = RUBY_VERSION >= '2.6' ? Net::HTTPClientException : Net::HTTPServerException

expect do
remote_config
end.to raise_error(Net::HTTPServerException,
end.to raise_error(exception,
'404 "" while downloading remote config file http://example.com/rubocop.yml')
end
end
Expand Down Expand Up @@ -120,9 +122,11 @@
end

it 'raises error' do
exception = RUBY_VERSION >= '2.6' ? Net::HTTPClientException : Net::HTTPServerException

expect do
remote_config
end.to raise_error(Net::HTTPServerException,
end.to raise_error(exception,
'404 "" while downloading remote config file http://example.com/rubocop.yml')
end
end
Expand Down

0 comments on commit 1d5621d

Please sign in to comment.