[ruby/uri] Suppress deprecate warning of test class and use EnvUtil.suppress_warning.

https://github.com/ruby/uri/commit/bd2e4be9d0
This commit is contained in:
Hiroshi SHIBATA 2024-11-26 10:47:12 +09:00 committed by git
parent 1d9dc4c504
commit 8655b9f7c6

View File

@ -10,23 +10,20 @@ class URI::TestCommon < Test::Unit::TestCase
def teardown def teardown
end end
class Foo EnvUtil.suppress_warning do
include URI::REGEXP::PATTERN class Foo
end include URI::REGEXP::PATTERN
end
def test_fallback_constants def test_fallback_constants
orig_verbose = $VERBOSE assert_raise(NameError) { URI::FOO }
$VERBOSE = nil
assert_raise(NameError) { URI::FOO } assert_equal URI::ABS_URI, URI::RFC2396_PARSER.regexp[:ABS_URI]
assert_equal URI::PATTERN, URI::RFC2396_Parser::PATTERN
assert_equal URI::ABS_URI, URI::RFC2396_PARSER.regexp[:ABS_URI] assert_equal URI::REGEXP, URI::RFC2396_REGEXP
assert_equal URI::PATTERN, URI::RFC2396_Parser::PATTERN assert_equal URI::REGEXP::PATTERN, URI::RFC2396_REGEXP::PATTERN
assert_equal URI::REGEXP, URI::RFC2396_REGEXP assert_equal Foo::IPV4ADDR, URI::RFC2396_REGEXP::PATTERN::IPV4ADDR
assert_equal URI::REGEXP::PATTERN, URI::RFC2396_REGEXP::PATTERN end
assert_equal Foo::IPV4ADDR, URI::RFC2396_REGEXP::PATTERN::IPV4ADDR
ensure
$VERBOSE = orig_verbose
end end
def test_parser_switch def test_parser_switch