HEX
Server: Apache
System: Linux s198.coreserver.jp 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC 2025 x86_64
User: nagasaki (10062)
PHP: 7.1.33
Disabled: NONE
Upload Files
File: //usr/local/rvm/src/ruby-2.7.4/spec/bundler/bundler/plugin/source_list_spec.rb
# frozen_string_literal: true

RSpec.describe Bundler::Plugin::SourceList do
  SourceList = Bundler::Plugin::SourceList

  before do
    allow(Bundler).to receive(:root) { Pathname.new "/" }
  end

  subject(:source_list) { SourceList.new }

  describe "adding sources uses classes for plugin" do
    it "uses Plugin::Installer::Rubygems for rubygems sources" do
      source = source_list.
        add_rubygems_source("remotes" => ["https://existing-rubygems.org"])
      expect(source).to be_instance_of(Bundler::Plugin::Installer::Rubygems)
    end

    it "uses Plugin::Installer::Git for git sources" do
      source = source_list.
        add_git_source("uri" => "git://existing-git.org/path.git")
      expect(source).to be_instance_of(Bundler::Plugin::Installer::Git)
    end
  end
end