summaryrefslogtreecommitdiff
path: root/spec/bundler/source/rubygems_spec.rb
diff options
context:
space:
mode:
authorAgis- <corestudiosinc@gmail.com>2015-08-18 20:50:56 +0300
committerAgis- <corestudiosinc@gmail.com>2015-08-21 20:52:00 +0300
commit6ecf575f50f8ae6dcd53fc7a55c51a20831b96c1 (patch)
tree4ab66a0db07beb7f55564e97ad61889731d92c53 /spec/bundler/source/rubygems_spec.rb
parent301bec2f2c636372d2c4a16e5b41b9ced08935b6 (diff)
downloadbundler-6ecf575f50f8ae6dcd53fc7a55c51a20831b96c1.tar.gz
Be stricter when accepting rubygem source URIs
Since `URI#parse` accepts URIs such as "http:rubygems.org" as per RFC 2396, we reject such sources manually early in the process, in order to provide more helpful error messages. Fixes #3925.
Diffstat (limited to 'spec/bundler/source/rubygems_spec.rb')
-rw-r--r--spec/bundler/source/rubygems_spec.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/bundler/source/rubygems_spec.rb b/spec/bundler/source/rubygems_spec.rb
index af959a770e..33cb3672dc 100644
--- a/spec/bundler/source/rubygems_spec.rb
+++ b/spec/bundler/source/rubygems_spec.rb
@@ -22,4 +22,12 @@ describe Bundler::Source::Rubygems do
end
end
end
+
+ describe "#add_remote" do
+ context "when the source is an HTTP(s) URI with no host" do
+ it "raises error" do
+ expect { subject.add_remote("https:rubygems.org") }.to raise_error(ArgumentError)
+ end
+ end
+ end
end