diff options
Diffstat (limited to 'spec/bundler/bundler/source/rubygems_spec.rb')
-rw-r--r-- | spec/bundler/bundler/source/rubygems_spec.rb | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/spec/bundler/bundler/source/rubygems_spec.rb b/spec/bundler/bundler/source/rubygems_spec.rb new file mode 100644 index 0000000000..b8f9f09c20 --- /dev/null +++ b/spec/bundler/bundler/source/rubygems_spec.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true +require "spec_helper" + +RSpec.describe Bundler::Source::Rubygems do + before do + allow(Bundler).to receive(:root) { Pathname.new("root") } + end + + describe "caches" do + it "includes Bundler.app_cache" do + expect(subject.caches).to include(Bundler.app_cache) + end + + it "includes GEM_PATH entries" do + Gem.path.each do |path| + expect(subject.caches).to include(File.expand_path("#{path}/cache")) + end + end + + it "is an array of strings or pathnames" do + subject.caches.each do |cache| + expect([String, Pathname]).to include(cache.class) + end + end + end + + describe "#add_remote" do + context "when the source is an HTTP(s) URI with no host" do + it "raises error" do + expect { subject.add_remote("https:rubygems.org") }.to raise_error(ArgumentError) + end + end + end +end |