diff options
author | Daniel Niknam <mhmd.niknam@gmail.com> | 2021-07-24 17:21:42 +1000 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2021-07-27 09:25:56 +0900 |
commit | 91a3f06e98682078493a9501bdbd1302673ad96b (patch) | |
tree | debfef4692a76998c00a2c033be2f92b6ac42bdd /spec/bundler | |
parent | 095b5bbcc168f324588d42d4ef233b446ed9f860 (diff) |
[rubygems/rubygems] Implement Bundler::Source::Rubygems#no_remotes?
This method is created to tell whether any remote exist in the object or not and it will be used by `Bundler:SourceList` to tell if a global source has been defined implicitly or not.
https://github.com/rubygems/rubygems/commit/47e3ff0e47
Diffstat (limited to 'spec/bundler')
-rw-r--r-- | spec/bundler/bundler/source/rubygems_spec.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/bundler/bundler/source/rubygems_spec.rb b/spec/bundler/bundler/source/rubygems_spec.rb index 7c457a7265..884fa81046 100644 --- a/spec/bundler/bundler/source/rubygems_spec.rb +++ b/spec/bundler/bundler/source/rubygems_spec.rb @@ -30,4 +30,18 @@ RSpec.describe Bundler::Source::Rubygems do end end end + + describe "#no_remotes?" do + context "when no remote provided" do + it "returns a truthy value" do + expect(described_class.new("remotes" => []).no_remotes?).to be_truthy + end + end + + context "when a remote provided" do + it "returns a falsey value" do + expect(described_class.new("remotes" => ["https://rubygems.org"]).no_remotes?).to be_falsey + end + end + end end |