[ruby/uri] Fallback missing constants with RFC3986_PARSER

(https://github.com/ruby/uri/pull/113)

* Fallback missing constants with RFC3986_PARSER

* raise missing constant

* Update test/uri/test_common.rb

Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>

* Update lib/uri/common.rb

Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>

* Update lib/uri/common.rb

Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>

---------

c2fdec079a

Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
This commit is contained in:
Hiroshi SHIBATA 2024-08-06 17:09:47 +08:00 committed by git
parent 24d46a6781
commit 267da552a1
2 changed files with 18 additions and 0 deletions

View file

@ -10,6 +10,15 @@ class URI::TestCommon < Test::Unit::TestCase
def teardown
end
def test_fallback_constants
orig_verbose = $VERBOSE
$VERBOSE = nil
assert URI::ABS_URI
assert_raise(NameError) { URI::FOO }
ensure
$VERBOSE = orig_verbose
end
def test_parser_switch
assert_equal(URI::Parser, URI::RFC3986_Parser)
refute defined?(URI::REGEXP)