diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2022-05-28 18:37:41 +0200 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2022-05-30 17:43:12 +0900 |
commit | d6684f063bc53e3cab025bd39526eca3b480b5e7 (patch) | |
tree | 0149db31abc96578f6c67c6f3ba1ac0b05f7ef45 /spec/bundler | |
parent | ea31c5bcd1bc1a019a6aee2b3f3b16813d7ff96d (diff) | |
download | ruby-d6684f063bc53e3cab025bd39526eca3b480b5e7.tar.gz |
[rubygems/rubygems] Fix crash when commenting out a mirror in configuration
https://github.com/rubygems/rubygems/commit/2d99277328
Diffstat (limited to 'spec/bundler')
-rw-r--r-- | spec/bundler/commands/config_spec.rb | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/spec/bundler/commands/config_spec.rb b/spec/bundler/commands/config_spec.rb index fb7aa3cc67..6148b1c7ce 100644 --- a/spec/bundler/commands/config_spec.rb +++ b/spec/bundler/commands/config_spec.rb @@ -435,6 +435,34 @@ E end end + describe "commented out settings with urls" do + before do + bundle "config set #mirror.https://rails-assets.org http://localhost:9292" + end + + it "does not make bundler crash and ignores the configuration" do + bundle "config list --parseable" + + expect(out).to eq("#mirror.https://rails-assets.org/=http://localhost:9292") + expect(err).to be_empty + + ruby(<<~RUBY) + require "#{entrypoint}" + print Bundler.settings.mirror_for("https://rails-assets.org") + RUBY + expect(out).to eq("https://rails-assets.org/") + expect(err).to be_empty + + bundle "config set mirror.all http://localhost:9293" + ruby(<<~RUBY) + require "#{entrypoint}" + print Bundler.settings.mirror_for("https://rails-assets.org") + RUBY + expect(out).to eq("http://localhost:9293/") + expect(err).to be_empty + end + end + describe "subcommands" do it "list" do bundle "config list", :env => { "BUNDLE_FOO" => "bar" } |