summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorDaniel Niknam <mhmd.niknam@gmail.com>2021-07-25 00:42:24 +1000
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2021-07-27 09:25:57 +0900
commit49176e8c8cc9a0f68810736663dc9c9a3cb3b774 (patch)
tree6029672eb39f1f77710af0f7a8fe4056f7338eed /spec
parent1ef360230ec0bf078124a3001ef2e1ae7886e236 (diff)
[rubygems/rubygems] Refactor Bundler::Dsl#check_rubygems_source_safety to improve readability
`check_rubygems_source_safety` is responsible for: 1. if there are multiple global sources - for bundle 3.x raise an error - for bundle 2.x print a warning 2. print a warning if there is no explicit global source The second responsibility was added recently and now the logic could be extracted to improve readability. Conditions are still live in the `check_rubygems_source_safety` method since we don't want to call both functions always and that would help us achieve that. https://github.com/rubygems/rubygems/commit/f3d7e946ee
Diffstat (limited to 'spec')
-rw-r--r--spec/bundler/bundler/dsl_spec.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/spec/bundler/bundler/dsl_spec.rb b/spec/bundler/bundler/dsl_spec.rb
index cfc4a7855d..e6cd43ab59 100644
--- a/spec/bundler/bundler/dsl_spec.rb
+++ b/spec/bundler/bundler/dsl_spec.rb
@@ -245,7 +245,7 @@ RSpec.describe Bundler::Dsl do
describe "#check_primary_source_safety" do
context "when a global source is not defined implicitly" do
it "will raise a major deprecation warning" do
- not_a_global_source = double("not-a-global-source", no_remotes?: true, multiple_remotes?: false)
+ not_a_global_source = double("not-a-global-source", :no_remotes? => true)
allow(Bundler::Source::Rubygems).to receive(:new).and_return(not_a_global_source)
warning = "This Gemfile does not include an explicit global source. " \