Skip to content

Commit

Permalink
Suppress a Ruby 3.4's obsoleted warning in test
Browse files Browse the repository at this point in the history
This PR suppresses the following Ruby 3.4's obsoleted warning in test:

```console
$ ruby -v
ruby 3.4.0dev (2024-09-01T11:00:13Z master eb144ef91e) [x86_64-darwin23]

$ bundle exec rspec spec/rubocop/ast/node_spec.rb:320
(snip)

/Users/koic/src/github.com/rubocop/rubocop-ast/spec/rubocop/ast/node_spec.rb:320:
warning: URI::RFC3986_PARSER.make_regexp is obsoleted. Use URI::RFC2396_PARSER.make_regexp explicitly.
```
  • Loading branch information
koic authored and marcandre committed Sep 4, 2024
1 parent abe2378 commit 108811b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion spec/rubocop/ast/node_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,15 @@ def used?
end

context 'with no interpolation' do
let(:src) { URI::DEFAULT_PARSER.make_regexp.inspect }
let(:src) do
# TODO: When supporting Ruby 3.3+ runtime, `URI::DEFAULT_PARSER` can be removed and
# only `URI::RFC2396_PARSER` can be used.
if defined?(URI::RFC2396_PARSER)
URI::RFC2396_PARSER
else
URI::DEFAULT_PARSER
end.make_regexp.inspect
end

it 'returns true' do
expect(node).to be_pure
Expand Down

0 comments on commit 108811b

Please sign in to comment.