Skip to content

Commit

Permalink
raise missing constant
Browse files Browse the repository at this point in the history
  • Loading branch information
hsbt committed Aug 6, 2024
1 parent f5fc97c commit e3e8549
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/uri/common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ def self.const_missing(const)
if RFC2396_PARSER.regexp[const]
warn "URI::#{const} is obsolete. Use RFC2396_PARSER.regexp[#{const.inspect}] explicitly.", uplevel: 1 if $VERBOSE
RFC2396_PARSER.regexp[const]
else
raise NameError, "uninitialized constant URI::#{const}"
end
end

Expand Down
1 change: 1 addition & 0 deletions test/uri/test_common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ def test_fallback_constants
orig_verbose = $VERBOSE
$VERBOSE = nil
assert URI::ABS_URI
assert_raise(NameError) { URI::FOO }
$VERBOSE = orig_verbose
end

Expand Down

0 comments on commit e3e8549

Please sign in to comment.