diff options
Diffstat (limited to 'spec/bundler/bundler/source/rubygems/remote_spec.rb')
-rw-r--r-- | spec/bundler/bundler/source/rubygems/remote_spec.rb | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/spec/bundler/bundler/source/rubygems/remote_spec.rb b/spec/bundler/bundler/source/rubygems/remote_spec.rb index 54394fc0ca..9a7ab42128 100644 --- a/spec/bundler/bundler/source/rubygems/remote_spec.rb +++ b/spec/bundler/bundler/source/rubygems/remote_spec.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true -require "spec_helper" + require "bundler/source/rubygems/remote" RSpec.describe Bundler::Source::Rubygems::Remote do @@ -8,7 +8,7 @@ RSpec.describe Bundler::Source::Rubygems::Remote do end before do - allow(Digest::MD5).to receive(:hexdigest).with(duck_type(:to_s)) {|string| "MD5HEX(#{string})" } + allow(Digest(:MD5)).to receive(:hexdigest).with(duck_type(:to_s)) {|string| "MD5HEX(#{string})" } end let(:uri_no_auth) { URI("https://gems.example.com") } @@ -22,7 +22,7 @@ RSpec.describe Bundler::Source::Rubygems::Remote do end it "applies configured credentials" do - Bundler.settings[uri_no_auth.to_s] = credentials + Bundler.settings.temporary(uri_no_auth.to_s => credentials) expect(remote(uri_no_auth).uri).to eq(uri_with_auth) end end @@ -33,7 +33,7 @@ RSpec.describe Bundler::Source::Rubygems::Remote do end it "does not apply given credentials" do - Bundler.settings[uri_no_auth.to_s] = credentials + Bundler.settings.temporary(uri_no_auth.to_s => credentials) expect(remote(uri_no_auth).anonymized_uri).to eq(uri_no_auth) end end @@ -44,7 +44,7 @@ RSpec.describe Bundler::Source::Rubygems::Remote do end it "only applies the given user" do - Bundler.settings[uri_no_auth.to_s] = credentials + Bundler.settings.temporary(uri_no_auth.to_s => credentials) expect(remote(uri_no_auth).cache_slug).to eq("gems.example.com.username.443.MD5HEX(gems.example.com.username.443./)") end end @@ -57,7 +57,7 @@ RSpec.describe Bundler::Source::Rubygems::Remote do end it "does not apply configured credentials" do - Bundler.settings[uri_no_auth.to_s] = "other:stuff" + Bundler.settings.temporary(uri_no_auth.to_s => "other:stuff") expect(remote(uri_with_auth).uri).to eq(uri_with_auth) end end @@ -68,7 +68,7 @@ RSpec.describe Bundler::Source::Rubygems::Remote do end it "does not apply given credentials" do - Bundler.settings[uri_no_auth.to_s] = "other:stuff" + Bundler.settings.temporary(uri_no_auth.to_s => "other:stuff") expect(remote(uri_with_auth).anonymized_uri).to eq(uri_no_auth) end end @@ -79,7 +79,7 @@ RSpec.describe Bundler::Source::Rubygems::Remote do end it "does not apply given credentials" do - Bundler.settings[uri_with_auth.to_s] = credentials + Bundler.settings.temporary(uri_with_auth.to_s => credentials) expect(remote(uri_with_auth).cache_slug).to eq("gems.example.com.username.443.MD5HEX(gems.example.com.username.443./)") end end @@ -106,7 +106,7 @@ RSpec.describe Bundler::Source::Rubygems::Remote do let(:mirror_uri_with_auth) { URI("https://username:password@rubygems-mirror.org/") } let(:mirror_uri_no_auth) { URI("https://rubygems-mirror.org/") } - before { Bundler.settings["mirror.https://rubygems.org/"] = mirror_uri_with_auth.to_s } + before { Bundler.settings.set_local("mirror.https://rubygems.org/", mirror_uri_with_auth.to_s) } specify "#uri returns the mirror URI with credentials" do expect(remote(uri).uri).to eq(mirror_uri_with_auth) @@ -131,8 +131,8 @@ RSpec.describe Bundler::Source::Rubygems::Remote do let(:mirror_uri_no_auth) { URI("https://rubygems-mirror.org/") } before do - Bundler.settings["mirror.https://rubygems.org/"] = mirror_uri_no_auth.to_s - Bundler.settings[mirror_uri_no_auth.to_s] = credentials + Bundler.settings.temporary("mirror.https://rubygems.org/" => mirror_uri_no_auth.to_s) + Bundler.settings.temporary(mirror_uri_no_auth.to_s => credentials) end specify "#uri returns the mirror URI with credentials" do |