Split URI::Parser examples with RFC2396 and RFC3986

Prepare for https://github.com/ruby/uri/pull/107
This commit is contained in:
Hiroshi SHIBATA 2024-07-18 12:41:49 +09:00
parent 509f1b50c2
commit e0f40dc9b0
No known key found for this signature in database
GPG Key ID: F9CF13417264FAC2

View File

@ -192,8 +192,15 @@ describe :uri_parse, shared: true do
file.should be_kind_of(URI::Generic)
end
it "raises errors on malformed URIs" do
-> { @object.parse('http://a_b:80/') }.should raise_error(URI::InvalidURIError)
-> { @object.parse('http://a_b/') }.should raise_error(URI::InvalidURIError)
if URI::DEFAULT_PARSER == URI::RFC2396_Parser
it "raises errors on malformed URIs" do
-> { @object.parse('http://a_b:80/') }.should raise_error(URI::InvalidURIError)
-> { @object.parse('http://a_b/') }.should raise_error(URI::InvalidURIError)
end
elsif URI::DEFAULT_PARSER == URI::RFC3986_Parser
it "does not raise errors on URIs contained underscore" do
-> { @object.parse('http://a_b:80/') }.should_not raise_error(URI::InvalidURIError)
-> { @object.parse('http://a_b/') }.should_not raise_error(URI::InvalidURIError)
end
end
end