Split URI::Parser examples with RFC2396 and RFC3986
Prepare for https://github.com/ruby/uri/pull/107
This commit is contained in:
parent
509f1b50c2
commit
e0f40dc9b0
@ -192,8 +192,15 @@ describe :uri_parse, shared: true do
|
|||||||
file.should be_kind_of(URI::Generic)
|
file.should be_kind_of(URI::Generic)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if URI::DEFAULT_PARSER == URI::RFC2396_Parser
|
||||||
it "raises errors on malformed URIs" do
|
it "raises errors on malformed URIs" do
|
||||||
-> { @object.parse('http://a_b:80/') }.should raise_error(URI::InvalidURIError)
|
-> { @object.parse('http://a_b:80/') }.should raise_error(URI::InvalidURIError)
|
||||||
-> { @object.parse('http://a_b/') }.should raise_error(URI::InvalidURIError)
|
-> { @object.parse('http://a_b/') }.should raise_error(URI::InvalidURIError)
|
||||||
end
|
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
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user