summaryrefslogtreecommitdiff
path: root/spec/bundler
diff options
context:
space:
mode:
authorDaniel Niknam <mhmd.niknam@gmail.com>2021-07-24 17:25:08 +1000
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2021-07-27 09:25:57 +0900
commitb500e8fab445d5a4ad91fd71e622aff88d0c7dd6 (patch)
treeb69a770bae4ef0f4ded23716e6dd21f77e9ca78e /spec/bundler
parent91a3f06e98682078493a9501bdbd1302673ad96b (diff)
downloadruby-b500e8fab445d5a4ad91fd71e622aff88d0c7dd6.tar.gz
[rubygems/rubygems] Implement Bundler::SourceList#implicit_global_source?
This method is created to tell whether any global source exist in the object or not and it will be used by `Bundler:Dsl` to print a warning if no global source has been defined in the Gemfile. https://github.com/rubygems/rubygems/commit/422fec4438
Diffstat (limited to 'spec/bundler')
-rw-r--r--spec/bundler/bundler/source_list_spec.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/bundler/bundler/source_list_spec.rb b/spec/bundler/bundler/source_list_spec.rb
index c2d1978b29..f860e9ff58 100644
--- a/spec/bundler/bundler/source_list_spec.rb
+++ b/spec/bundler/bundler/source_list_spec.rb
@@ -441,4 +441,19 @@ RSpec.describe Bundler::SourceList do
source_list.remote!
end
end
+
+ describe "implicit_global_source?" do
+ context "when a global rubygem source provided" do
+ it "returns a falsy value" do
+ source_list.add_global_rubygems_remote("https://rubygems.org")
+
+ expect(source_list.implicit_global_source?).to be_falsey
+ end
+ end
+ context "when no global rubygem source provided" do
+ it "returns a truthy value" do
+ expect(source_list.implicit_global_source?).to be_truthy
+ end
+ end
+ end
end