Skip to content

Commit

Permalink
add spec for URI#parse
Browse files Browse the repository at this point in the history
  • Loading branch information
moozzi committed May 12, 2023
1 parent aca4695 commit 3f00a26
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion library/uri/generic/host_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@
require 'uri'

describe "URI::Generic#host" do
it "needs to be reviewed for spec completeness"
ruby_version_is "3.2" do
# https://hackerone.com/reports/156615
it "returns empty string when host is empty" do
URI.parse('http:////foo.com').host.should == ''
end
end
end

describe "URI::Generic#host=" do
Expand Down
7 changes: 6 additions & 1 deletion library/uri/generic/to_s_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,10 @@
require 'uri'

describe "URI::Generic#to_s" do
it "needs to be reviewed for spec completeness"
ruby_version_is "3.2" do
# https://hackerone.com/reports/156615
it "preserves / characters when host is empty" do
URI('http:///foo.com').to_s.should == 'http:///foo.com'
end
end
end

0 comments on commit 3f00a26

Please sign in to comment.