diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-05-06 18:06:21 +0200 |
---|---|---|
committer | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-06-11 12:36:19 +0200 |
commit | 5946d62ad03c57271ccb037680382b1db9fc2e65 (patch) | |
tree | 31be4479c7d942243440b378c054ef6d4308e398 /spec/install/gemfile | |
parent | e6fd423bbdf6fc2aa1032a5e35df7b4079c45ddd (diff) | |
download | bundler-5946d62ad03c57271ccb037680382b1db9fc2e65.tar.gz |
Normalize file:// handling in specs
Diffstat (limited to 'spec/install/gemfile')
-rw-r--r-- | spec/install/gemfile/eval_gemfile_spec.rb | 2 | ||||
-rw-r--r-- | spec/install/gemfile/gemspec_spec.rb | 46 | ||||
-rw-r--r-- | spec/install/gemfile/git_spec.rb | 80 | ||||
-rw-r--r-- | spec/install/gemfile/groups_spec.rb | 16 | ||||
-rw-r--r-- | spec/install/gemfile/install_if.rb | 4 | ||||
-rw-r--r-- | spec/install/gemfile/lockfile_spec.rb | 2 | ||||
-rw-r--r-- | spec/install/gemfile/path_spec.rb | 28 | ||||
-rw-r--r-- | spec/install/gemfile/platform_spec.rb | 60 | ||||
-rw-r--r-- | spec/install/gemfile/ruby_spec.rb | 20 | ||||
-rw-r--r-- | spec/install/gemfile/sources_spec.rb | 98 | ||||
-rw-r--r-- | spec/install/gemfile/specific_platform_spec.rb | 4 |
11 files changed, 180 insertions, 180 deletions
diff --git a/spec/install/gemfile/eval_gemfile_spec.rb b/spec/install/gemfile/eval_gemfile_spec.rb index 035d3692aa..7df94aaff5 100644 --- a/spec/install/gemfile/eval_gemfile_spec.rb +++ b/spec/install/gemfile/eval_gemfile_spec.rb @@ -71,7 +71,7 @@ RSpec.describe "bundle install with gemfile that uses eval_gemfile" do create_file "other/Gemfile-other", "gem 'rack'" create_file "other/Gemfile", "eval_gemfile 'Gemfile-other'" create_file "Gemfile-alt", <<-G - source "file:#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" eval_gemfile "other/Gemfile" G install_gemfile! "eval_gemfile File.expand_path('Gemfile-alt')" diff --git a/spec/install/gemfile/gemspec_spec.rb b/spec/install/gemfile/gemspec_spec.rb index bf1f4d7b9a..ecb8358ccc 100644 --- a/spec/install/gemfile/gemspec_spec.rb +++ b/spec/install/gemfile/gemspec_spec.rb @@ -15,7 +15,7 @@ RSpec.describe "bundle install from an existing gemspec" do s.add_development_dependency "bar-dev", "=1.0.0" end install_gemfile <<-G - source "file://#{gem_repo2}" + source "#{file_uri_for(gem_repo2)}" gemspec :path => '#{tmp.join("foo")}' G @@ -32,7 +32,7 @@ RSpec.describe "bundle install from an existing gemspec" do FileUtils.mv tmp.join("foo", "foo.gemspec"), tmp.join("foo", ".gemspec") install_gemfile <<-G - source "file://#{gem_repo2}" + source "#{file_uri_for(gem_repo2)}" gemspec :path => '#{tmp.join("foo")}' G @@ -51,7 +51,7 @@ RSpec.describe "bundle install from an existing gemspec" do s.add_dependency "baz", ">= 1.0", "< 1.1" end install_gemfile <<-G - source "file://#{gem_repo2}" + source "#{file_uri_for(gem_repo2)}" gemspec :path => '#{tmp.join("foo")}' G @@ -62,7 +62,7 @@ RSpec.describe "bundle install from an existing gemspec" do build_lib("foo", :path => tmp.join("foo"), :gemspec => false) install_gemfile(<<-G) - source "file://#{gem_repo2}" + source "#{file_uri_for(gem_repo2)}" gemspec :path => '#{tmp.join("foo")}' G expect(err).to match(/There are no gemspecs at #{tmp.join('foo')}/) @@ -74,7 +74,7 @@ RSpec.describe "bundle install from an existing gemspec" do end install_gemfile(<<-G) - source "file://#{gem_repo2}" + source "#{file_uri_for(gem_repo2)}" gemspec :path => '#{tmp.join("foo")}' G expect(err).to match(/There are multiple gemspecs at #{tmp.join('foo')}/) @@ -88,7 +88,7 @@ RSpec.describe "bundle install from an existing gemspec" do end install_gemfile(<<-G) - source "file://#{gem_repo2}" + source "#{file_uri_for(gem_repo2)}" gemspec :path => '#{tmp.join("foo")}', :name => 'foo' G @@ -104,7 +104,7 @@ RSpec.describe "bundle install from an existing gemspec" do end install_gemfile(<<-G) - source "file://#{gem_repo2}" + source "#{file_uri_for(gem_repo2)}" gemspec :path => '#{tmp.join("foo")}', :name => 'foo', :development_group => :dev G @@ -115,7 +115,7 @@ RSpec.describe "bundle install from an existing gemspec" do it "should match a lockfile even if the gemspec defines development dependencies" do build_lib("foo", :path => tmp.join("foo")) do |s| - s.write("Gemfile", "source 'file://#{gem_repo1}'\ngemspec") + s.write("Gemfile", "source '#{file_uri_for(gem_repo1)}'\ngemspec") s.add_dependency "actionpack", "=2.3.2" s.add_development_dependency "rake", "=12.3.2" end @@ -140,7 +140,7 @@ RSpec.describe "bundle install from an existing gemspec" do end install_gemfile! <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gemspec :path => '#{tmp.join("foo")}' G @@ -159,7 +159,7 @@ RSpec.describe "bundle install from an existing gemspec" do end install_gemfile! <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gemspec :path => '#{tmp.join("foo")}' G @@ -231,7 +231,7 @@ RSpec.describe "bundle install from an existing gemspec" do build_gem "foo", "0.0.1", :to_bundle => true install_gemfile <<-G - source "file://#{gem_repo2}" + source "#{file_uri_for(gem_repo2)}" gem "deps" gemspec :path => '#{tmp.join("foo")}', :name => 'foo' G @@ -252,7 +252,7 @@ RSpec.describe "bundle install from an existing gemspec" do end install_gemfile! <<-G - source "file://#{gem_repo2}" + source "#{file_uri_for(gem_repo2)}" gem "deps" gemspec :path => '#{tmp.join("foo")}', :name => 'foo' G @@ -285,7 +285,7 @@ RSpec.describe "bundle install from an existing gemspec" do end install_gemfile! <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gemspec G @@ -318,7 +318,7 @@ RSpec.describe "bundle install from an existing gemspec" do it "should install the child gemspec's deps" do install_gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gemspec G @@ -440,7 +440,7 @@ RSpec.describe "bundle install from an existing gemspec" do %w[ruby jruby].each do |platform| simulate_platform(platform) do install_gemfile <<-G - source "file://localhost#{gem_repo2}" + source "#{file_uri_for(gem_repo2)}" gemspec G end @@ -456,7 +456,7 @@ RSpec.describe "bundle install from an existing gemspec" do context "as a runtime dependency" do it "keeps java dependencies in the lockfile" do expect(the_bundle).to include_gems "foo 1.0", "platform_specific 1.0 RUBY" - expect(lockfile).to eq normalize_uri_file(strip_whitespace(<<-L)) + expect(lockfile).to eq strip_whitespace(<<-L) PATH remote: . specs: @@ -464,7 +464,7 @@ RSpec.describe "bundle install from an existing gemspec" do platform_specific GEM - remote: file://localhost#{gem_repo2}/ + remote: #{file_uri_for(gem_repo2)}/ specs: platform_specific (1.0) platform_specific (1.0-java) @@ -487,14 +487,14 @@ RSpec.describe "bundle install from an existing gemspec" do it "keeps java dependencies in the lockfile" do expect(the_bundle).to include_gems "foo 1.0", "platform_specific 1.0 RUBY" - expect(lockfile).to eq normalize_uri_file(strip_whitespace(<<-L)) + expect(lockfile).to eq strip_whitespace(<<-L) PATH remote: . specs: foo (1.0) GEM - remote: file://localhost#{gem_repo2}/ + remote: #{file_uri_for(gem_repo2)}/ specs: platform_specific (1.0) platform_specific (1.0-java) @@ -519,14 +519,14 @@ RSpec.describe "bundle install from an existing gemspec" do it "keeps java dependencies in the lockfile" do expect(the_bundle).to include_gems "foo 1.0", "indirect_platform_specific 1.0", "platform_specific 1.0 RUBY" - expect(lockfile).to eq normalize_uri_file(strip_whitespace(<<-L)) + expect(lockfile).to eq strip_whitespace(<<-L) PATH remote: . specs: foo (1.0) GEM - remote: file://localhost#{gem_repo2}/ + remote: #{file_uri_for(gem_repo2)}/ specs: indirect_platform_specific (1.0) platform_specific @@ -563,7 +563,7 @@ RSpec.describe "bundle install from an existing gemspec" do simulate_platform "ruby" install_gemfile! <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gemspec :path => '#{tmp.join("foo")}', :name => 'foo' G @@ -574,7 +574,7 @@ RSpec.describe "bundle install from an existing gemspec" do simulate_platform "ruby" install_gemfile! <<-G, forgotten_command_line_options(:without => "development") - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gemspec :path => '#{tmp.join("foo")}', :name => 'foo' G diff --git a/spec/install/gemfile/git_spec.rb b/spec/install/gemfile/git_spec.rb index 8ca22f1d87..fe51650f76 100644 --- a/spec/install/gemfile/git_spec.rb +++ b/spec/install/gemfile/git_spec.rb @@ -8,7 +8,7 @@ RSpec.describe "bundle install with git sources" do end install_gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" git "#{lib_path("foo-1.0")}" do gem 'foo' end @@ -143,7 +143,7 @@ RSpec.describe "bundle install with git sources" do Dir.chdir tmp("bundled_app.bck") gemfile tmp("bundled_app.bck/Gemfile"), <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" git "#{lib_path("foo-1.0")}" do gem 'foo' end @@ -161,7 +161,7 @@ RSpec.describe "bundle install with git sources" do before do build_git "foo" gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem "rack" git "#{lib_path("foo-1.0")}" do @@ -402,7 +402,7 @@ RSpec.describe "bundle install with git sources" do end gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem "rack", :git => "#{lib_path("rack-0.8")}", :branch => "master" G @@ -423,7 +423,7 @@ RSpec.describe "bundle install with git sources" do end install_gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem "rack", :git => "#{lib_path("rack-0.8")}", :branch => "master" G @@ -443,7 +443,7 @@ RSpec.describe "bundle install with git sources" do end install_gemfile! <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem "rack", :git => "#{lib_path("rack-0.8")}", :branch => "master" G @@ -459,7 +459,7 @@ RSpec.describe "bundle install with git sources" do build_git "rack", "0.8" install_gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem "rack", :git => "#{lib_path("rack-0.8")}", :branch => "master" G @@ -481,7 +481,7 @@ RSpec.describe "bundle install with git sources" do build_git "rack", "0.8" install_gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem "rack", :git => "#{lib_path("rack-0.8")}", :branch => "master" G @@ -501,7 +501,7 @@ RSpec.describe "bundle install with git sources" do build_git "rack", "0.8" install_gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem "rack", :git => "#{lib_path("rack-0.8")}", :branch => "master" G @@ -523,7 +523,7 @@ RSpec.describe "bundle install with git sources" do FileUtils.cp_r("#{lib_path("rack-0.8")}/.", lib_path("local-rack")) install_gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem "rack", :git => "#{lib_path("rack-0.8")}" G @@ -545,7 +545,7 @@ RSpec.describe "bundle install with git sources" do FileUtils.cp_r("#{lib_path("rack-0.8")}/.", lib_path("local-rack")) install_gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem "rack", :git => "#{lib_path("rack-0.8")}" G @@ -565,7 +565,7 @@ RSpec.describe "bundle install with git sources" do end install_gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem "rack", :git => "#{lib_path("rack-0.8")}", :branch => "master" G @@ -582,7 +582,7 @@ RSpec.describe "bundle install with git sources" do end install_gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem "rack", :git => "#{lib_path("rack-0.8")}", :branch => "master" G @@ -613,7 +613,7 @@ RSpec.describe "bundle install with git sources" do build_git "rack", "0.8" install_gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem "rack", :git => "#{lib_path("rack-0.8")}" G @@ -632,7 +632,7 @@ RSpec.describe "bundle install with git sources" do end install_gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem "foo", :git => "#{lib_path("nested")}" G @@ -642,14 +642,14 @@ RSpec.describe "bundle install with git sources" do it "correctly unlocks when changing to a git source" do install_gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem "rack", "0.9.1" G build_git "rack", :path => lib_path("rack") install_gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem "rack", "1.0.0", :git => "#{lib_path("rack")}" G @@ -658,14 +658,14 @@ RSpec.describe "bundle install with git sources" do it "correctly unlocks when changing to a git source without versions" do install_gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem "rack" G build_git "rack", "1.2", :path => lib_path("rack") install_gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem "rack", :git => "#{lib_path("rack")}" G @@ -712,7 +712,7 @@ RSpec.describe "bundle install with git sources" do end install_gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem "foo", :git => "#{lib_path("foo-1.0")}" gem "rails", "2.3.2" G @@ -742,7 +742,7 @@ RSpec.describe "bundle install with git sources" do end install_gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem "bar", :git => "#{lib_path("foo")}" gem "rails", "2.3.2" G @@ -769,7 +769,7 @@ RSpec.describe "bundle install with git sources" do build_git "foo", :gemspec => false install_gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem "foo", "1.0", :git => "#{lib_path("foo-1.0")}" gem "rails", "2.3.2" G @@ -957,12 +957,12 @@ RSpec.describe "bundle install with git sources" do end install_gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem "bar", :path => "#{lib_path("bar")}" G install_gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem "bar", :git => "#{lib_path("bar")}" G @@ -971,7 +971,7 @@ RSpec.describe "bundle install with git sources" do it "doesn't explode when switching Gem to Git source" do install_gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem "rack-obama" gem "rack", "1.0.0" G @@ -981,7 +981,7 @@ RSpec.describe "bundle install with git sources" do end install_gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem "rack-obama" gem "rack", "1.0.0", :git => "#{lib_path("rack-1.0")}" G @@ -996,7 +996,7 @@ RSpec.describe "bundle install with git sources" do build_git "valim" install_gemfile <<-G - gem "valim", :git => "file://#{lib_path("valim-1.0")}" + gem "valim", :git => "#{file_uri_for(lib_path("valim-1.0"))}" G old_revision = revision_for(lib_path("valim-1.0")) @@ -1023,12 +1023,12 @@ RSpec.describe "bundle install with git sources" do revision = revision_for(lib_path("foo-1.0")) install_gemfile <<-G - gem "foo", :git => "file://#{lib_path("foo-1.0")}", :ref => "#{revision}" + gem "foo", :git => "#{file_uri_for(lib_path("foo-1.0"))}", :ref => "#{revision}" G expect(out).to_not match(/Revision.*does not exist/) install_gemfile <<-G - gem "foo", :git => "file://#{lib_path("foo-1.0")}", :ref => "deadbeef" + gem "foo", :git => "#{file_uri_for(lib_path("foo-1.0"))}", :ref => "deadbeef" G expect(err).to include("Revision deadbeef does not exist in the repository") end @@ -1039,7 +1039,7 @@ RSpec.describe "bundle install with git sources" do build_git "valim", :path => lib_path("valim") install_gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem "valim", "= 1.0", :git => "#{lib_path("valim")}" G @@ -1128,7 +1128,7 @@ RSpec.describe "bundle install with git sources" do end install_gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem "foo", :git => "#{lib_path("foo-1.0")}" G @@ -1168,7 +1168,7 @@ RSpec.describe "bundle install with git sources" do git_commit_sha = git_reader.ref_for("HEAD") install_gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem "foo", :git => "#{lib_path("foo-1.0")}", :ref => "#{git_commit_sha}" G @@ -1193,7 +1193,7 @@ RSpec.describe "bundle install with git sources" do end install_gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem "foo", :git => "#{lib_path("foo-1.0")}" G @@ -1223,7 +1223,7 @@ In Gemfile: end install_gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem "foo", :git => "#{lib_path("foo-1.0")}" G @@ -1236,7 +1236,7 @@ In Gemfile: expect(installed_time).to match(/\A\d+\.\d+\z/) install_gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem "foo", :git => "#{lib_path("foo-1.0")}" G @@ -1264,7 +1264,7 @@ In Gemfile: end install_gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem "rack", "0.9.1" gem "foo", :git => "#{lib_path("foo-1.0")}" G @@ -1278,7 +1278,7 @@ In Gemfile: expect(installed_time).to match(/\A\d+\.\d+\z/) install_gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem "rack", "1.0.0" gem "foo", :git => "#{lib_path("foo-1.0")}" G @@ -1307,7 +1307,7 @@ In Gemfile: end install_gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem "foo", :git => "#{lib_path("foo-1.0")}" G @@ -1322,7 +1322,7 @@ In Gemfile: expect(installed_time).to match(/\A\d+\.\d+\z/) install_gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem "foo", :git => "#{lib_path("foo-1.0")}", :branch => "branch2" G @@ -1355,7 +1355,7 @@ In Gemfile: ENV["GIT_WORK_TREE"] = "bar" install_gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" git "#{lib_path("xxxxxx-1.0")}" do gem 'xxxxxx' end diff --git a/spec/install/gemfile/groups_spec.rb b/spec/install/gemfile/groups_spec.rb index f836499148..b38e8b43d5 100644 --- a/spec/install/gemfile/groups_spec.rb +++ b/spec/install/gemfile/groups_spec.rb @@ -4,7 +4,7 @@ RSpec.describe "bundle install with groups" do describe "installing with no options" do before :each do install_gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem "rack" group :emo do gem "activesupport", "2.3.5" @@ -74,7 +74,7 @@ RSpec.describe "bundle install with groups" do describe "with gems assigned to a single group" do before :each do gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem "rack" group :emo do gem "activesupport", "2.3.5" @@ -115,7 +115,7 @@ RSpec.describe "bundle install with groups" do it "does not effect the resolve" do gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem "activesupport" group :emo do gem "rails", "2.3.2" @@ -243,7 +243,7 @@ RSpec.describe "bundle install with groups" do describe "with gems assigned to multiple groups" do before :each do gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem "rack" group :emo, :lolercoaster do gem "activesupport", "2.3.5" @@ -264,7 +264,7 @@ RSpec.describe "bundle install with groups" do describe "with a gem defined multiple times in different groups" do before :each do gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem "rack" group :emo do @@ -302,7 +302,7 @@ RSpec.describe "bundle install with groups" do describe "nesting groups" do before :each do gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem "rack" group :emo do group :lolercoaster do @@ -327,7 +327,7 @@ RSpec.describe "bundle install with groups" do describe "when loading only the default group" do it "should not load all groups" do install_gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem "rack" gem "activesupport", :groups => :development G @@ -354,7 +354,7 @@ RSpec.describe "bundle install with groups" do build_repo2 system_gems "rack-0.9.1" do install_gemfile <<-G, forgotten_command_line_options(:without => "rack") - source "file://#{gem_repo2}" + source "#{file_uri_for(gem_repo2)}" gem "rack" group :rack do diff --git a/spec/install/gemfile/install_if.rb b/spec/install/gemfile/install_if.rb index 1319051fdb..bfdd8fbae8 100644 --- a/spec/install/gemfile/install_if.rb +++ b/spec/install/gemfile/install_if.rb @@ -3,7 +3,7 @@ describe "bundle install with install_if conditionals" do it "follows the install_if DSL" do install_gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" install_if(lambda { true }) do gem "activesupport", "2.3.5" end @@ -20,7 +20,7 @@ describe "bundle install with install_if conditionals" do lockfile_should_be <<-L GEM - remote: file:#{gem_repo1}/ + remote: #{file_uri_for(gem_repo1)}/ specs: activesupport (2.3.5) foo (1.0) diff --git a/spec/install/gemfile/lockfile_spec.rb b/spec/install/gemfile/lockfile_spec.rb index 96cd5067be..b9545b91c2 100644 --- a/spec/install/gemfile/lockfile_spec.rb +++ b/spec/install/gemfile/lockfile_spec.rb @@ -2,7 +2,7 @@ RSpec.describe "bundle install with a lockfile present" do let(:gf) { <<-G } - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem "rack", "1.0.0" G diff --git a/spec/install/gemfile/path_spec.rb b/spec/install/gemfile/path_spec.rb index e80764070c..cfd85ac73f 100644 --- a/spec/install/gemfile/path_spec.rb +++ b/spec/install/gemfile/path_spec.rb @@ -106,7 +106,7 @@ RSpec.describe "bundle install with explicit source paths" do end install_gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem "foo", :path => "#{lib_path("nested")}" G @@ -196,7 +196,7 @@ RSpec.describe "bundle install with explicit source paths" do end gemfile = <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gemspec G @@ -215,7 +215,7 @@ RSpec.describe "bundle install with explicit source paths" do end install_gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gemspec :path => "#{lib_path("foo")}" G @@ -231,7 +231,7 @@ RSpec.describe "bundle install with explicit source paths" do Dir.chdir lib_path("foo") install_gemfile lib_path("foo/Gemfile"), <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gemspec G @@ -252,7 +252,7 @@ RSpec.describe "bundle install with explicit source paths" do Dir.chdir lib_path("foo") install_gemfile lib_path("foo/Gemfile"), <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gemspec G @@ -390,7 +390,7 @@ RSpec.describe "bundle install with explicit source paths" do context "existing lockfile" do it "rubygems gems don't re-resolve without changes" do install_gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem 'rack-obama', '1.0' gem 'net-ssh', '1.0' G @@ -410,7 +410,7 @@ RSpec.describe "bundle install with explicit source paths" do end install_gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem 'rack-obama', :path => "#{lib_path("omg")}" gem 'net-ssh', :path => "#{lib_path("omg")}" G @@ -470,7 +470,7 @@ RSpec.describe "bundle install with explicit source paths" do build_lib "foo", "1.0", :path => lib_path("foo") install_gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem "foo", :path => "#{lib_path("foo")}" G end @@ -502,7 +502,7 @@ RSpec.describe "bundle install with explicit source paths" do rack (= 0.9.1) GEM - remote: #{URI.parse("file://#{gem_repo1}/")} + remote: #{file_uri_for(gem_repo1)}/ specs: rack (0.9.1) @@ -530,7 +530,7 @@ RSpec.describe "bundle install with explicit source paths" do rack GEM - remote: #{URI.parse("file://#{gem_repo1}/")} + remote: #{file_uri_for(gem_repo1)}/ specs: rack (0.9.1) @@ -559,12 +559,12 @@ RSpec.describe "bundle install with explicit source paths" do end install_gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem "bar", :git => "#{lib_path("bar")}" G install_gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem "bar", :path => "#{lib_path("bar")}" G @@ -578,7 +578,7 @@ RSpec.describe "bundle install with explicit source paths" do end install_gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem "bar" path "#{lib_path("foo")}" do gem "foo" @@ -588,7 +588,7 @@ RSpec.describe "bundle install with explicit source paths" do build_lib "bar", "1.0", :path => lib_path("foo/bar") install_gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" path "#{lib_path("foo")}" do gem "foo" gem "bar" diff --git a/spec/install/gemfile/platform_spec.rb b/spec/install/gemfile/platform_spec.rb index 891f766cc0..c389c71032 100644 --- a/spec/install/gemfile/platform_spec.rb +++ b/spec/install/gemfile/platform_spec.rb @@ -4,7 +4,7 @@ RSpec.describe "bundle install across platforms" do it "maintains the same lockfile if all gems are compatible across platforms" do lockfile <<-G GEM - remote: file:#{gem_repo1}/ + remote: #{file_uri_for(gem_repo1)}/ specs: rack (0.9.1) @@ -16,7 +16,7 @@ RSpec.describe "bundle install across platforms" do G install_gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem "rack" G @@ -27,7 +27,7 @@ RSpec.describe "bundle install across platforms" do it "pulls in the correct platform specific gem" do lockfile <<-G GEM - remote: file:#{gem_repo1} + remote: #{file_uri_for(gem_repo1)} specs: platform_specific (1.0) platform_specific (1.0-java) @@ -42,7 +42,7 @@ RSpec.describe "bundle install across platforms" do simulate_platform "java" install_gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem "platform_specific" G @@ -53,7 +53,7 @@ RSpec.describe "bundle install across platforms" do it "works with gems that have different dependencies" do simulate_platform "java" install_gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem "nokogiri" G @@ -64,7 +64,7 @@ RSpec.describe "bundle install across platforms" do simulate_platform "ruby" install_gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem "nokogiri" G @@ -96,15 +96,15 @@ RSpec.describe "bundle install across platforms" do simulate_platform java install_gemfile! <<-G - source "file://localhost/#{gem_repo4}" + source "#{file_uri_for(gem_repo4)}" gem "empyrean", "0.1.0" gem "pry" G - expect(the_bundle.lockfile).to read_as normalize_uri_file(strip_whitespace(<<-L)) + expect(the_bundle.lockfile).to read_as strip_whitespace(<<-L) GEM - remote: file://localhost/#{gem_repo4}/ + remote: #{file_uri_for(gem_repo4)}/ specs: coderay (1.1.2) empyrean (0.1.0) @@ -132,7 +132,7 @@ RSpec.describe "bundle install across platforms" do good_lockfile = strip_whitespace(<<-L) GEM - remote: file://localhost/#{gem_repo4}/ + remote: #{file_uri_for(gem_repo4)}/ specs: coderay (1.1.2) empyrean (0.1.0) @@ -160,11 +160,11 @@ RSpec.describe "bundle install across platforms" do #{Bundler::VERSION} L - expect(the_bundle.lockfile).to read_as normalize_uri_file(good_lockfile) + expect(the_bundle.lockfile).to read_as good_lockfile bad_lockfile = strip_whitespace <<-L GEM - remote: file://localhost/#{gem_repo4}/ + remote: #{file_uri_for(gem_repo4)}/ specs: coderay (1.1.2) empyrean (0.1.0) @@ -196,30 +196,30 @@ RSpec.describe "bundle install across platforms" do aggregate_failures do lockfile bad_lockfile bundle! :install - expect(the_bundle.lockfile).to read_as normalize_uri_file(good_lockfile) + expect(the_bundle.lockfile).to read_as good_lockfile lockfile bad_lockfile bundle! :update, :all => true - expect(the_bundle.lockfile).to read_as normalize_uri_file(good_lockfile) + expect(the_bundle.lockfile).to read_as good_lockfile lockfile bad_lockfile bundle! "update ffi" - expect(the_bundle.lockfile).to read_as normalize_uri_file(good_lockfile) + expect(the_bundle.lockfile).to read_as good_lockfile lockfile bad_lockfile bundle! "update empyrean" - expect(the_bundle.lockfile).to read_as normalize_uri_file(good_lockfile) + expect(the_bundle.lockfile).to read_as good_lockfile lockfile bad_lockfile bundle! :lock - expect(the_bundle.lockfile).to read_as normalize_uri_file(good_lockfile) + expect(the_bundle.lockfile).to read_as good_lockfile end end it "works the other way with gems that have different dependencies" do simulate_platform "ruby" install_gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem "nokogiri" G @@ -243,7 +243,7 @@ RSpec.describe "bundle install across platforms" do end install_gemfile! <<-G - source "file://#{gem_repo2}" + source "#{file_uri_for(gem_repo2)}" gem "facter" G @@ -258,7 +258,7 @@ RSpec.describe "bundle install across platforms" do it "fetches gems again after changing the version of Ruby" do gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem "rack", "1.0.0" G @@ -275,7 +275,7 @@ end RSpec.describe "bundle install with platform conditionals" do it "installs gems tagged w/ the current platforms" do install_gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" platforms :#{local_tag} do gem "nokogiri" @@ -287,7 +287,7 @@ RSpec.describe "bundle install with platform conditionals" do it "does not install gems tagged w/ another platforms" do install_gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem "rack" platforms :#{not_local_tag} do gem "nokogiri" @@ -300,7 +300,7 @@ RSpec.describe "bundle install with platform conditionals" do it "installs gems tagged w/ the current platforms inline" do install_gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem "nokogiri", :platforms => :#{local_tag} G expect(the_bundle).to include_gems "nokogiri 1.4.2" @@ -308,7 +308,7 @@ RSpec.describe "bundle install with platform conditionals" do it "does not install gems tagged w/ another platforms inline" do install_gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem "rack" gem "nokogiri", :platforms => :#{not_local_tag} G @@ -318,7 +318,7 @@ RSpec.describe "bundle install with platform conditionals" do it "installs gems tagged w/ the current platform inline" do install_gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem "nokogiri", :platform => :#{local_tag} G expect(the_bundle).to include_gems "nokogiri 1.4.2" @@ -326,7 +326,7 @@ RSpec.describe "bundle install with platform conditionals" do it "doesn't install gems tagged w/ another platform inline" do install_gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem "nokogiri", :platform => :#{not_local_tag} G expect(the_bundle).not_to include_gems "nokogiri 1.4.2" @@ -350,7 +350,7 @@ RSpec.describe "bundle install with platform conditionals" do simulate_ruby_engine "ruby" gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem "some_gem", :platform => :rbx G @@ -364,7 +364,7 @@ RSpec.describe "bundle install with platform conditionals" do other_ruby_version_tag = RUBY_VERSION =~ /^1\.8/ ? :ruby_19 : :ruby_18 gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem "some_gem", platform: :#{other_ruby_version_tag} G @@ -377,7 +377,7 @@ RSpec.describe "bundle install with platform conditionals" do simulate_ruby_engine "ruby" gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem "rack", :platform => [:mingw, :mswin, :x64_mingw, :jruby] G @@ -397,7 +397,7 @@ The dependency #{Gem::Dependency.new("rack", ">= 0")} will be unused by any of t simulate_ruby_engine "ruby" gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem "rack", :platform => [:mingw, :mswin, :x64_mingw, :jruby] G diff --git a/spec/install/gemfile/ruby_spec.rb b/spec/install/gemfile/ruby_spec.rb index 3373c9bd3e..d1e9fc7e05 100644 --- a/spec/install/gemfile/ruby_spec.rb +++ b/spec/install/gemfile/ruby_spec.rb @@ -10,13 +10,13 @@ RSpec.describe "ruby requirement" do # requirement. This test verifies the fix, committed in bfbad5c5. it "allows adding gems" do install_gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" ruby "#{RUBY_VERSION}" gem "rack" G install_gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" ruby "#{RUBY_VERSION}" gem "rack" gem "rack-obama" @@ -28,7 +28,7 @@ RSpec.describe "ruby requirement" do it "allows removing the ruby version requirement" do install_gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" ruby "~> #{RUBY_VERSION}" gem "rack" G @@ -36,7 +36,7 @@ RSpec.describe "ruby requirement" do expect(lockfile).to include("RUBY VERSION") install_gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem "rack" G @@ -46,7 +46,7 @@ RSpec.describe "ruby requirement" do it "allows changing the ruby version requirement to something compatible" do install_gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" ruby ">= 1.0.0" gem "rack" G @@ -56,7 +56,7 @@ RSpec.describe "ruby requirement" do simulate_ruby_version "5100" install_gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" ruby ">= 1.0.1" gem "rack" G @@ -67,7 +67,7 @@ RSpec.describe "ruby requirement" do it "allows changing the ruby version requirement to something incompatible" do install_gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" ruby ">= 1.0.0" gem "rack" G @@ -77,7 +77,7 @@ RSpec.describe "ruby requirement" do simulate_ruby_version "5100" install_gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" ruby ">= 5000.0" gem "rack" G @@ -88,7 +88,7 @@ RSpec.describe "ruby requirement" do it "allows requirements with trailing whitespace" do install_gemfile! <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" ruby "#{RUBY_VERSION}\\n \t\\n" gem "rack" G @@ -98,7 +98,7 @@ RSpec.describe "ruby requirement" do it "fails gracefully with malformed requirements" do install_gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" ruby ">= 0", "-.\\0" gem "rack" G diff --git a/spec/install/gemfile/sources_spec.rb b/spec/install/gemfile/sources_spec.rb index da364a51bb..7af97958c1 100644 --- a/spec/install/gemfile/sources_spec.rb +++ b/spec/install/gemfile/sources_spec.rb @@ -20,8 +20,8 @@ RSpec.describe "bundle install with gems on multiple sources" do before do gemfile <<-G - source "file://localhost#{gem_repo3}" - source "file://localhost#{gem_repo1}" + source "#{file_uri_for(gem_repo3)}" + source "#{file_uri_for(gem_repo1)}" gem "rack-obama" gem "rack" G @@ -31,7 +31,7 @@ RSpec.describe "bundle install with gems on multiple sources" do bundle :install expect(err).to include("Warning: the gem 'rack' was found in multiple sources.") - expect(err).to include(normalize_uri_file("Installed from: file://localhost#{gem_repo1}")) + expect(err).to include("Installed from: #{file_uri_for(gem_repo1)}") expect(the_bundle).to include_gems("rack-obama 1.0.0", "rack 1.0.0", :source => "remote1") end @@ -47,8 +47,8 @@ RSpec.describe "bundle install with gems on multiple sources" do before do gemfile <<-G - source "file://localhost#{gem_repo3}" - source "file://localhost#{gem_repo1}" + source "#{file_uri_for(gem_repo3)}" + source "#{file_uri_for(gem_repo1)}" gem "rack-obama" gem "rack", "1.0.0" # force it to install the working version in repo1 G @@ -58,7 +58,7 @@ RSpec.describe "bundle install with gems on multiple sources" do it "warns about ambiguous gems, but installs anyway", :bundler => "2" do expect(err).to include("Warning: the gem 'rack' was found in multiple sources.") - expect(err).to include(normalize_uri_file("Installed from: file://localhost#{gem_repo1}")) + expect(err).to include("Installed from: #{file_uri_for(gem_repo1)}") expect(the_bundle).to include_gems("rack-obama 1.0.0", "rack 1.0.0", :source => "remote1") end @@ -85,8 +85,8 @@ RSpec.describe "bundle install with gems on multiple sources" do end gemfile <<-G - source "file://#{gem_repo3}" - source "file://#{gem_repo1}" do + source "#{file_uri_for(gem_repo3)}" + source "#{file_uri_for(gem_repo1)}" do gem "thin" # comes first to test name sorting gem "rack" end @@ -128,9 +128,9 @@ RSpec.describe "bundle install with gems on multiple sources" do end gemfile <<-G - source "file://#{gem_repo3}" + source "#{file_uri_for(gem_repo3)}" gem "rack-obama" # should come from repo3! - gem "rack", :source => "file://#{gem_repo1}" + gem "rack", :source => "#{file_uri_for(gem_repo1)}" G end @@ -158,8 +158,8 @@ RSpec.describe "bundle install with gems on multiple sources" do end gemfile <<-G - source "file://#{gem_repo2}" - source "file://#{gem_repo3}" do + source "#{file_uri_for(gem_repo2)}" + source "#{file_uri_for(gem_repo3)}" do gem "depends_on_rack" end G @@ -222,8 +222,8 @@ RSpec.describe "bundle install with gems on multiple sources" do context "and not in any other sources" do before do gemfile <<-G - source "file://#{gem_repo2}" - source "file://#{gem_repo3}" do + source "#{file_uri_for(gem_repo2)}" + source "#{file_uri_for(gem_repo3)}" do gem "depends_on_rack" end G @@ -239,9 +239,9 @@ RSpec.describe "bundle install with gems on multiple sources" do context "and in yet another source", :bundler => "< 3" do before do gemfile <<-G - source "file://localhost#{gem_repo1}" - source "file://localhost#{gem_repo2}" - source "file://localhost#{gem_repo3}" do + source "#{file_uri_for(gem_repo1)}" + source "#{file_uri_for(gem_repo2)}" + source "#{file_uri_for(gem_repo3)}" do gem "depends_on_rack" end G @@ -251,7 +251,7 @@ RSpec.describe "bundle install with gems on multiple sources" do it "installs from the other source and warns about ambiguous gems", :bundler => "2" do expect(err).to include("Warning: the gem 'rack' was found in multiple sources.") - expect(err).to include(normalize_uri_file("Installed from: file://localhost#{gem_repo2}")) + expect(err).to include("Installed from: #{file_uri_for(gem_repo2)}") expect(the_bundle).to include_gems("depends_on_rack 1.0.1", "rack 1.0.0") end @@ -271,11 +271,11 @@ RSpec.describe "bundle install with gems on multiple sources" do end gemfile <<-G - source "file://#{gem_repo3}" # contains depends_on_rack - source "file://#{gem_repo2}" # contains broken rack + source "#{file_uri_for(gem_repo3)}" # contains depends_on_rack + source "#{file_uri_for(gem_repo2)}" # contains broken rack gem "depends_on_rack" # installed from gem_repo3 - gem "rack", :source => "file://#{gem_repo1}" + gem "rack", :source => "#{file_uri_for(gem_repo1)}" G end @@ -321,11 +321,11 @@ RSpec.describe "bundle install with gems on multiple sources" do end gemfile <<-G - source "file://#{gem_repo2}" + source "#{file_uri_for(gem_repo2)}" gem "depends_on_rack" - source "file://#{gem_repo3}" do + source "#{file_uri_for(gem_repo3)}" do gem "unrelated_gem" end G @@ -389,8 +389,8 @@ RSpec.describe "bundle install with gems on multiple sources" do end gemfile <<-G - source "file://#{gem_repo3}" - gem "not_in_repo1", :source => "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo3)}" + gem "not_in_repo1", :source => "#{file_uri_for(gem_repo1)}" G end @@ -406,8 +406,8 @@ RSpec.describe "bundle install with gems on multiple sources" do lockfile <<-L GEM - remote: file:#{gem_repo1} - remote: file:#{gem_repo3} + remote: #{file_uri_for(gem_repo1)} + remote: #{file_uri_for(gem_repo3)} specs: rack (0.9.1) @@ -419,8 +419,8 @@ RSpec.describe "bundle install with gems on multiple sources" do L gemfile <<-G - source "file://#{gem_repo1}" - source "file://#{gem_repo3}" do + source "#{file_uri_for(gem_repo1)}" + source "#{file_uri_for(gem_repo3)}" do gem 'rack' end G @@ -437,7 +437,7 @@ RSpec.describe "bundle install with gems on multiple sources" do build_lib "foo" gemfile <<-G - gem "rack", :source => "file://#{gem_repo1}" + gem "rack", :source => "#{file_uri_for(gem_repo1)}" gem "foo", :path => "#{lib_path("foo-1.0")}" G end @@ -457,7 +457,7 @@ RSpec.describe "bundle install with gems on multiple sources" do system_gems "rack-0.9.1" gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem "rack" # shoud come from repo1! G end @@ -479,10 +479,10 @@ RSpec.describe "bundle install with gems on multiple sources" do # Installing this gemfile... gemfile <<-G - source 'file://#{gem_repo1}' + source '#{file_uri_for(gem_repo1)}' gem 'rack' - gem 'foo', '~> 0.1', :source => 'file://#{gem_repo4}' - gem 'bar', '~> 0.1', :source => 'file://#{gem_repo4}' + gem 'foo', '~> 0.1', :source => '#{file_uri_for(gem_repo4)}' + gem 'bar', '~> 0.1', :source => '#{file_uri_for(gem_repo4)}' G bundle! :install, forgotten_command_line_options(:path => "../gems/system") @@ -497,10 +497,10 @@ RSpec.describe "bundle install with gems on multiple sources" do it "allows them to be unlocked separately" do # And install this gemfile, updating only foo. install_gemfile <<-G - source 'file://#{gem_repo1}' + source '#{file_uri_for(gem_repo1)}' gem 'rack' - gem 'foo', '~> 0.2', :source => 'file://#{gem_repo4}' - gem 'bar', '~> 0.1', :source => 'file://#{gem_repo4}' + gem 'foo', '~> 0.2', :source => '#{file_uri_for(gem_repo4)}' + gem 'bar', '~> 0.1', :source => '#{file_uri_for(gem_repo4)}' G # It should update foo to 0.2, but not the (locked) bar 0.1 @@ -518,10 +518,10 @@ RSpec.describe "bundle install with gems on multiple sources" do build_git "git2" install_gemfile <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem "rails" - source "file://#{gem_repo3}" do + source "#{file_uri_for(gem_repo3)}" do gem "rack" end @@ -543,15 +543,15 @@ RSpec.describe "bundle install with gems on multiple sources" do context "when a gem is installed to system gems" do before do install_gemfile! <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem "rack" G end context "and the gemfile changes" do it "is still able to find that gem from remote sources" do - source_uri = "file://#{gem_repo1}" - second_uri = "file://#{gem_repo4}" + source_uri = "#{file_uri_for(gem_repo1)}" + second_uri = "#{file_uri_for(gem_repo4)}" build_repo4 do build_gem "rack", "2.0.1.1.forked" @@ -589,7 +589,7 @@ RSpec.describe "bundle install with gems on multiple sources" do describe "source changed to one containing a higher version of a dependency" do before do install_gemfile! <<-G - source "file://#{gem_repo1}" + source "#{file_uri_for(gem_repo1)}" gem "rack" G @@ -603,7 +603,7 @@ RSpec.describe "bundle install with gems on multiple sources" do end install_gemfile <<-G - source "file://#{gem_repo2}" + source "#{file_uri_for(gem_repo2)}" gem "rack" gemspec :path => "#{tmp.join("gemspec_test")}" G @@ -628,17 +628,17 @@ RSpec.describe "bundle install with gems on multiple sources" do end install_gemfile <<-G - source "file://localhost#{gem_repo4}" - source "file://localhost#{gem_repo1}" do + source "#{file_uri_for(gem_repo4)}" + source "#{file_uri_for(gem_repo1)}" do gem "thin" end gem "depends_on_rack" G expect(last_command).to be_failure - expect(err).to eq normalize_uri_file(strip_whitespace(<<-EOS).strip) + expect(err).to eq strip_whitespace(<<-EOS).strip The gem 'rack' was found in multiple relevant sources. - * rubygems repository file://localhost#{gem_repo1}/ or installed locally - * rubygems repository file://localhost#{gem_repo4}/ or installed locally + * rubygems repository #{file_uri_for(gem_repo1)}/ or installed locally + * rubygems repository #{file_uri_for(gem_repo4)}/ or installed locally You must add this gem to the source block for the source you wish it to be installed from. EOS expect(the_bundle).not_to be_locked diff --git a/spec/install/gemfile/specific_platform_spec.rb b/spec/install/gemfile/specific_platform_spec.rb index 2c482b7ad4..24b602589f 100644 --- a/spec/install/gemfile/specific_platform_spec.rb +++ b/spec/install/gemfile/specific_platform_spec.rb @@ -49,7 +49,7 @@ RSpec.describe "bundle install with specific_platform enabled" do end let(:google_protobuf) { <<-G } - source "file:#{gem_repo2}" + source "#{file_uri_for(gem_repo2)}" gem "google-protobuf" G @@ -75,7 +75,7 @@ RSpec.describe "bundle install with specific_platform enabled" do it "uses the platform-specific gem with extra dependencies" do install_gemfile! <<-G - source "file:#{gem_repo2}" + source "#{file_uri_for(gem_repo2)}" gem "facter" G |