1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[rubygems/rubygems] s/install_gemfile!/install_gemfile

4d1a0c465a
This commit is contained in:
David Rodríguez 2020-06-03 20:46:03 +02:00 committed by Hiroshi SHIBATA
parent 1436b5026c
commit 696a50751b
Notes: git 2020-06-18 19:15:05 +09:00
45 changed files with 159 additions and 159 deletions

View file

@ -128,12 +128,12 @@ RSpec.describe "bundle executable" do
end end
it "doesn't print defaults" do it "doesn't print defaults" do
install_gemfile! "", :verbose => true install_gemfile "", :verbose => true
expect(out).to start_with("Running `bundle install --retry 0 --verbose` with bundler #{Bundler::VERSION}") expect(out).to start_with("Running `bundle install --retry 0 --verbose` with bundler #{Bundler::VERSION}")
end end
it "doesn't print defaults" do it "doesn't print defaults" do
install_gemfile! "", :verbose => true install_gemfile "", :verbose => true
expect(out).to start_with("Running `bundle install --retry 0 --verbose` with bundler #{Bundler::VERSION}") expect(out).to start_with("Running `bundle install --retry 0 --verbose` with bundler #{Bundler::VERSION}")
end end
end end

View file

@ -54,7 +54,7 @@ RSpec.describe "bundle cache with git" do
it "runs twice without exploding" do it "runs twice without exploding" do
build_git "foo" build_git "foo"
install_gemfile! <<-G install_gemfile <<-G
gem "foo", :git => '#{lib_path("foo-1.0")}' gem "foo", :git => '#{lib_path("foo-1.0")}'
G G

View file

@ -200,7 +200,7 @@ RSpec.describe "bundle add" do
describe "when a gem is added which is already specified in Gemfile with version" do describe "when a gem is added which is already specified in Gemfile with version" do
it "shows an error when added with different version requirement" do it "shows an error when added with different version requirement" do
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo2)}" source "#{file_uri_for(gem_repo2)}"
gem "rack", "1.0" gem "rack", "1.0"
G G
@ -212,7 +212,7 @@ RSpec.describe "bundle add" do
end end
it "shows error when added without version requirements" do it "shows error when added without version requirements" do
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo2)}" source "#{file_uri_for(gem_repo2)}"
gem "rack", "1.0" gem "rack", "1.0"
G G
@ -227,7 +227,7 @@ RSpec.describe "bundle add" do
describe "when a gem is added which is already specified in Gemfile without version" do describe "when a gem is added which is already specified in Gemfile without version" do
it "shows an error when added with different version requirement" do it "shows an error when added with different version requirement" do
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo2)}" source "#{file_uri_for(gem_repo2)}"
gem "rack" gem "rack"
G G

View file

@ -44,7 +44,7 @@ RSpec.describe "bundle binstubs <gem>" do
end end
it "allows installing all binstubs" do it "allows installing all binstubs" do
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}" source "#{file_uri_for(gem_repo1)}"
gem "rails" gem "rails"
G G
@ -109,7 +109,7 @@ RSpec.describe "bundle binstubs <gem>" do
R R
end end
end end
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo2)}" source "#{file_uri_for(gem_repo2)}"
gem "rack" gem "rack"
gem "prints_loaded_gems" gem "prints_loaded_gems"

View file

@ -222,7 +222,7 @@ RSpec.describe "bundle cache" do
end end
bundle "config --local without wo" bundle "config --local without wo"
install_gemfile! <<-G install_gemfile <<-G
source "file:#{gem_repo1}" source "file:#{gem_repo1}"
gem "rack" gem "rack"
group :wo do group :wo do
@ -295,7 +295,7 @@ RSpec.describe "bundle install with gem sources" do
it "does not hit the remote at all" do it "does not hit the remote at all" do
build_repo2 build_repo2
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo2)}" source "#{file_uri_for(gem_repo2)}"
gem "rack" gem "rack"
G G

View file

@ -102,7 +102,7 @@ RSpec.describe "bundle check" do
it "uses the without setting" do it "uses the without setting" do
bundle "config set without foo" bundle "config set without foo"
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}" source "#{file_uri_for(gem_repo1)}"
group :foo do group :foo do
gem "rack" gem "rack"
@ -207,7 +207,7 @@ RSpec.describe "bundle check" do
end end
it "fails when there's no lock file and frozen is set" do it "fails when there's no lock file and frozen is set" do
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}" source "#{file_uri_for(gem_repo1)}"
gem "foo" gem "foo"
G G

View file

@ -366,14 +366,14 @@ RSpec.describe "bundle clean" do
it "does not call clean automatically when using system gems" do it "does not call clean automatically when using system gems" do
bundle "config set path.system true" bundle "config set path.system true"
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}" source "#{file_uri_for(gem_repo1)}"
gem "thin" gem "thin"
gem "rack" gem "rack"
G G
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}" source "#{file_uri_for(gem_repo1)}"
gem "rack" gem "rack"
@ -430,7 +430,7 @@ RSpec.describe "bundle clean" do
it "automatically cleans when path has not been set", :bundler => "3" do it "automatically cleans when path has not been set", :bundler => "3" do
build_repo2 build_repo2
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo2)}" source "#{file_uri_for(gem_repo2)}"
gem "foo" gem "foo"

View file

@ -7,7 +7,7 @@ require "bundler/cli/doctor"
RSpec.describe "bundle doctor" do RSpec.describe "bundle doctor" do
before(:each) do before(:each) do
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}" source "#{file_uri_for(gem_repo1)}"
gem "rack" gem "rack"
G G

View file

@ -355,7 +355,7 @@ RSpec.describe "bundle exec" do
it "raises a helpful error when exec'ing to something outside of the bundle" do it "raises a helpful error when exec'ing to something outside of the bundle" do
bundle "config set clean false" # want to keep the rackup binstub bundle "config set clean false" # want to keep the rackup binstub
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}" source "#{file_uri_for(gem_repo1)}"
gem "with_license" gem "with_license"
G G
@ -895,7 +895,7 @@ __FILE__: #{path.to_s.inspect}
skip "https://github.com/rubygems/bundler/issues/6898" if Gem.win_platform? skip "https://github.com/rubygems/bundler/issues/6898" if Gem.win_platform?
skip "openssl isn't a default gem" if expected.empty? skip "openssl isn't a default gem" if expected.empty?
install_gemfile! "" # must happen before installing the broken system gem install_gemfile "" # must happen before installing the broken system gem
build_repo4 do build_repo4 do
build_gem "openssl", openssl_version do |s| build_gem "openssl", openssl_version do |s|
@ -935,7 +935,7 @@ __FILE__: #{path.to_s.inspect}
before do before do
build_git "simple_git_binary", &:add_c_extension build_git "simple_git_binary", &:add_c_extension
bundle "config set --local path .bundle" bundle "config set --local path .bundle"
install_gemfile! <<-G install_gemfile <<-G
gem "simple_git_binary", :git => '#{lib_path("simple_git_binary-1.0")}' gem "simple_git_binary", :git => '#{lib_path("simple_git_binary-1.0")}'
G G
end end

View file

@ -3,7 +3,7 @@
RSpec.describe "bundle info" do RSpec.describe "bundle info" do
context "with a standard Gemfile" do context "with a standard Gemfile" do
before do before do
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}" source "#{file_uri_for(gem_repo1)}"
gem "rails" gem "rails"
gem "has_metadata" gem "has_metadata"
@ -96,7 +96,7 @@ RSpec.describe "bundle info" do
end end
it "prints out git info" do it "prints out git info" do
install_gemfile! <<-G install_gemfile <<-G
gem "foo", :git => "#{lib_path("foo-1.0")}" gem "foo", :git => "#{lib_path("foo-1.0")}"
G G
expect(the_bundle).to include_gems "foo 1.0" expect(the_bundle).to include_gems "foo 1.0"
@ -111,7 +111,7 @@ RSpec.describe "bundle info" do
end end
@revision = revision_for(lib_path("foo-1.0"))[0...6] @revision = revision_for(lib_path("foo-1.0"))[0...6]
install_gemfile! <<-G install_gemfile <<-G
gem "foo", :git => "#{lib_path("foo-1.0")}", :branch => "omg" gem "foo", :git => "#{lib_path("foo-1.0")}", :branch => "omg"
G G
expect(the_bundle).to include_gems "foo 1.0.omg" expect(the_bundle).to include_gems "foo 1.0.omg"
@ -122,7 +122,7 @@ RSpec.describe "bundle info" do
it "doesn't print the branch when tied to a ref" do it "doesn't print the branch when tied to a ref" do
sha = revision_for(lib_path("foo-1.0")) sha = revision_for(lib_path("foo-1.0"))
install_gemfile! <<-G install_gemfile <<-G
gem "foo", :git => "#{lib_path("foo-1.0")}", :ref => "#{sha}" gem "foo", :git => "#{lib_path("foo-1.0")}", :ref => "#{sha}"
G G
@ -132,7 +132,7 @@ RSpec.describe "bundle info" do
it "handles when a version is a '-' prerelease" do it "handles when a version is a '-' prerelease" do
@git = build_git("foo", "1.0.0-beta.1", :path => lib_path("foo")) @git = build_git("foo", "1.0.0-beta.1", :path => lib_path("foo"))
install_gemfile! <<-G install_gemfile <<-G
gem "foo", "1.0.0-beta.1", :git => "#{lib_path("foo")}" gem "foo", "1.0.0-beta.1", :git => "#{lib_path("foo")}"
G G
expect(the_bundle).to include_gems "foo 1.0.0.pre.beta.1" expect(the_bundle).to include_gems "foo 1.0.0.pre.beta.1"
@ -144,7 +144,7 @@ RSpec.describe "bundle info" do
context "with a valid regexp for gem name" do context "with a valid regexp for gem name" do
it "presents alternatives", :readline do it "presents alternatives", :readline do
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}" source "#{file_uri_for(gem_repo1)}"
gem "rack" gem "rack"
gem "rack-obama" gem "rack-obama"
@ -157,7 +157,7 @@ RSpec.describe "bundle info" do
context "with an invalid regexp for gem name" do context "with an invalid regexp for gem name" do
it "does not find the gem" do it "does not find the gem" do
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}" source "#{file_uri_for(gem_repo1)}"
gem "rails" gem "rails"
G G

View file

@ -557,7 +557,7 @@ RSpec.describe "bundle install with gem sources" do
context "after installing with --standalone" do context "after installing with --standalone" do
before do before do
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}" source "#{file_uri_for(gem_repo1)}"
gem "rack" gem "rack"
G G

View file

@ -18,7 +18,7 @@ RSpec.describe "bundle pristine", :ruby_repo do
build_lib "bar", :path => lib_path("bar") build_lib "bar", :path => lib_path("bar")
end end
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo2)}" source "#{file_uri_for(gem_repo2)}"
gem "weakling" gem "weakling"
gem "very_simple_binary" gem "very_simple_binary"

View file

@ -3,7 +3,7 @@
RSpec.describe "bundle show", :bundler => "< 3" do RSpec.describe "bundle show", :bundler => "< 3" do
context "with a standard Gemfile" do context "with a standard Gemfile" do
before :each do before :each do
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}" source "#{file_uri_for(gem_repo1)}"
gem "rails" gem "rails"
G G
@ -94,7 +94,7 @@ RSpec.describe "bundle show", :bundler => "< 3" do
end end
it "prints out git info" do it "prints out git info" do
install_gemfile! <<-G install_gemfile <<-G
gem "foo", :git => "#{lib_path("foo-1.0")}" gem "foo", :git => "#{lib_path("foo-1.0")}"
G G
expect(the_bundle).to include_gems "foo 1.0" expect(the_bundle).to include_gems "foo 1.0"
@ -109,7 +109,7 @@ RSpec.describe "bundle show", :bundler => "< 3" do
end end
@revision = revision_for(lib_path("foo-1.0"))[0...6] @revision = revision_for(lib_path("foo-1.0"))[0...6]
install_gemfile! <<-G install_gemfile <<-G
gem "foo", :git => "#{lib_path("foo-1.0")}", :branch => "omg" gem "foo", :git => "#{lib_path("foo-1.0")}", :branch => "omg"
G G
expect(the_bundle).to include_gems "foo 1.0.omg" expect(the_bundle).to include_gems "foo 1.0.omg"
@ -120,7 +120,7 @@ RSpec.describe "bundle show", :bundler => "< 3" do
it "doesn't print the branch when tied to a ref" do it "doesn't print the branch when tied to a ref" do
sha = revision_for(lib_path("foo-1.0")) sha = revision_for(lib_path("foo-1.0"))
install_gemfile! <<-G install_gemfile <<-G
gem "foo", :git => "#{lib_path("foo-1.0")}", :ref => "#{sha}" gem "foo", :git => "#{lib_path("foo-1.0")}", :ref => "#{sha}"
G G
@ -130,7 +130,7 @@ RSpec.describe "bundle show", :bundler => "< 3" do
it "handles when a version is a '-' prerelease" do it "handles when a version is a '-' prerelease" do
@git = build_git("foo", "1.0.0-beta.1", :path => lib_path("foo")) @git = build_git("foo", "1.0.0-beta.1", :path => lib_path("foo"))
install_gemfile! <<-G install_gemfile <<-G
gem "foo", "1.0.0-beta.1", :git => "#{lib_path("foo")}" gem "foo", "1.0.0-beta.1", :git => "#{lib_path("foo")}"
G G
expect(the_bundle).to include_gems "foo 1.0.0.pre.beta.1" expect(the_bundle).to include_gems "foo 1.0.0.pre.beta.1"
@ -166,7 +166,7 @@ RSpec.describe "bundle show", :bundler => "< 3" do
context "with a valid regexp for gem name" do context "with a valid regexp for gem name" do
it "presents alternatives", :readline do it "presents alternatives", :readline do
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}" source "#{file_uri_for(gem_repo1)}"
gem "rack" gem "rack"
gem "rack-obama" gem "rack-obama"
@ -179,7 +179,7 @@ RSpec.describe "bundle show", :bundler => "< 3" do
context "with an invalid regexp for gem name" do context "with an invalid regexp for gem name" do
it "does not find the gem" do it "does not find the gem" do
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}" source "#{file_uri_for(gem_repo1)}"
gem "rails" gem "rails"
G G
@ -198,7 +198,7 @@ RSpec.describe "bundle show", :bundler => "< 3" do
end end
it "doesn't update gems to newer versions" do it "doesn't update gems to newer versions" do
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo2)}" source "#{file_uri_for(gem_repo2)}"
gem "rails" gem "rails"
G G

View file

@ -75,19 +75,19 @@ RSpec.describe "bundle update" do
before { bundle "config set update_requires_all_flag true" } before { bundle "config set update_requires_all_flag true" }
it "errors when passed nothing" do it "errors when passed nothing" do
install_gemfile! "" install_gemfile ""
bundle :update, :raise_on_error => false bundle :update, :raise_on_error => false
expect(err).to eq("To update everything, pass the `--all` flag.") expect(err).to eq("To update everything, pass the `--all` flag.")
end end
it "errors when passed --all and another option" do it "errors when passed --all and another option" do
install_gemfile! "" install_gemfile ""
bundle "update --all foo", :raise_on_error => false bundle "update --all foo", :raise_on_error => false
expect(err).to eq("Cannot specify --all along with specific options.") expect(err).to eq("Cannot specify --all along with specific options.")
end end
it "updates everything when passed --all" do it "updates everything when passed --all" do
install_gemfile! "" install_gemfile ""
bundle "update --all" bundle "update --all"
expect(out).to include("Bundle updated!") expect(out).to include("Bundle updated!")
end end
@ -153,7 +153,7 @@ RSpec.describe "bundle update" do
end end
end end
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo4)}" source "#{file_uri_for(gem_repo4)}"
gem "slim-rails" gem "slim-rails"
gem "slim_lint" gem "slim_lint"
@ -179,7 +179,7 @@ RSpec.describe "bundle update" do
build_gem "b", "2.0" build_gem "b", "2.0"
end end
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo4)}" source "#{file_uri_for(gem_repo4)}"
gem "a" gem "a"
gem "b" gem "b"
@ -306,7 +306,7 @@ RSpec.describe "bundle update" do
describe "with --source option" do describe "with --source option" do
it "should not update gems not included in the source that happen to have the same name", :bundler => "< 3" do it "should not update gems not included in the source that happen to have the same name", :bundler => "< 3" do
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo2)}" source "#{file_uri_for(gem_repo2)}"
gem "activesupport" gem "activesupport"
G G
@ -317,7 +317,7 @@ RSpec.describe "bundle update" do
end end
it "should not update gems not included in the source that happen to have the same name", :bundler => "3" do it "should not update gems not included in the source that happen to have the same name", :bundler => "3" do
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo2)}" source "#{file_uri_for(gem_repo2)}"
gem "activesupport" gem "activesupport"
G G
@ -456,7 +456,7 @@ RSpec.describe "bundle update in more complicated situations" do
end end
it "will warn when some explicitly updated gems are not updated" do it "will warn when some explicitly updated gems are not updated" do
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo2)}" source "#{file_uri_for(gem_repo2)}"
gem "thin" gem "thin"
@ -476,7 +476,7 @@ RSpec.describe "bundle update in more complicated situations" do
it "will not warn when an explicitly updated git gem changes sha but not version" do it "will not warn when an explicitly updated git gem changes sha but not version" do
build_git "foo" build_git "foo"
install_gemfile! <<-G install_gemfile <<-G
gem "foo", :git => '#{lib_path("foo-1.0")}' gem "foo", :git => '#{lib_path("foo-1.0")}'
G G
@ -492,7 +492,7 @@ RSpec.describe "bundle update in more complicated situations" do
it "will not warn when changing gem sources but not versions" do it "will not warn when changing gem sources but not versions" do
build_git "rack" build_git "rack"
install_gemfile! <<-G install_gemfile <<-G
gem "rack", :git => '#{lib_path("rack-1.0")}' gem "rack", :git => '#{lib_path("rack-1.0")}'
G G
@ -674,7 +674,7 @@ RSpec.describe "bundle update" do
build_gem "foo" build_gem "foo"
end end
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo4)}" source "#{file_uri_for(gem_repo4)}"
gem "bar" gem "bar"
gem "foo" gem "foo"
@ -819,7 +819,7 @@ RSpec.describe "bundle update --bundler" do
build_gem "rack", "1.0" build_gem "rack", "1.0"
end end
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo4)}" source "#{file_uri_for(gem_repo4)}"
gem "rack" gem "rack"
G G

View file

@ -7,7 +7,7 @@ RSpec.describe "bundle install with :allow_offline_install" do
context "with no cached data locally" do context "with no cached data locally" do
it "still installs" do it "still installs" do
install_gemfile! <<-G, :artifice => "compact_index" install_gemfile <<-G, :artifice => "compact_index"
source "http://testgemserver.local" source "http://testgemserver.local"
gem "rack-obama" gem "rack-obama"
G G
@ -29,7 +29,7 @@ RSpec.describe "bundle install with :allow_offline_install" do
system_gems ["rack-1.0.0"], :path => default_bundle_path system_gems ["rack-1.0.0"], :path => default_bundle_path
bundle "config set clean false" bundle "config set clean false"
install_gemfile! <<-G, :artifice => "compact_index" install_gemfile <<-G, :artifice => "compact_index"
source "http://testgemserver.local" source "http://testgemserver.local"
gem "rack-obama" gem "rack-obama"
gem "rack", "< 1.0" gem "rack", "< 1.0"
@ -74,7 +74,7 @@ RSpec.describe "bundle install with :allow_offline_install" do
git = build_git "a", "1.0.0", :path => lib_path("a") git = build_git "a", "1.0.0", :path => lib_path("a")
update_git("a", :path => git.path, :branch => "new_branch") update_git("a", :path => git.path, :branch => "new_branch")
install_gemfile! <<-G install_gemfile <<-G
gem "a", :git => #{git.path.to_s.dump} gem "a", :git => #{git.path.to_s.dump}
G G
@ -83,7 +83,7 @@ RSpec.describe "bundle install with :allow_offline_install" do
expect(the_bundle).to be_locked expect(the_bundle).to be_locked
break_git_remote_ops! do break_git_remote_ops! do
install_gemfile! <<-G install_gemfile <<-G
gem "a", :git => #{git.path.to_s.dump}, :branch => "new_branch" gem "a", :git => #{git.path.to_s.dump}, :branch => "new_branch"
G G
end end

View file

@ -132,7 +132,7 @@ RSpec.describe "bundle install" do
end end
it "does not cause a conflict if new dependencies in the Gemfile require older dependencies than the lockfile" do it "does not cause a conflict if new dependencies in the Gemfile require older dependencies than the lockfile" do
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo2)}" source "#{file_uri_for(gem_repo2)}"
gem 'rails', "2.3.2" gem 'rails', "2.3.2"
G G
@ -151,7 +151,7 @@ RSpec.describe "bundle install" do
system_gems "bundler-99999999.99.1" system_gems "bundler-99999999.99.1"
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo2)}" source "#{file_uri_for(gem_repo2)}"
gem "rails", "3.0" gem "rails", "3.0"
G G
@ -165,7 +165,7 @@ RSpec.describe "bundle install" do
system_gems "bundler-99999999.99.1" system_gems "bundler-99999999.99.1"
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo2)}" source "#{file_uri_for(gem_repo2)}"
gem "rails", "3.0" gem "rails", "3.0"
G G
@ -184,7 +184,7 @@ RSpec.describe "bundle install" do
end end
end end
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo4)}" source "#{file_uri_for(gem_repo4)}"
gem "requires_nonexistant_bundler" gem "requires_nonexistant_bundler"
G G

View file

@ -97,7 +97,7 @@ RSpec.describe "install in deployment or frozen mode" do
end end
it "works with sources given by a block" do it "works with sources given by a block" do
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}" do source "#{file_uri_for(gem_repo1)}" do
gem "rack" gem "rack"
end end
@ -226,7 +226,7 @@ RSpec.describe "install in deployment or frozen mode" do
it "works if a path gem is missing but is in a without group" do it "works if a path gem is missing but is in a without group" do
build_lib "path_gem" build_lib "path_gem"
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}" source "#{file_uri_for(gem_repo1)}"
gem "rake" gem "rake"
gem "path_gem", :path => "#{lib_path("path_gem-1.0")}", :group => :development gem "path_gem", :path => "#{lib_path("path_gem-1.0")}", :group => :development
@ -244,7 +244,7 @@ RSpec.describe "install in deployment or frozen mode" do
it "explodes if a path gem is missing" do it "explodes if a path gem is missing" do
build_lib "path_gem" build_lib "path_gem"
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}" source "#{file_uri_for(gem_repo1)}"
gem "rake" gem "rake"
gem "path_gem", :path => "#{lib_path("path_gem-1.0")}", :group => :development gem "path_gem", :path => "#{lib_path("path_gem-1.0")}", :group => :development
@ -418,7 +418,7 @@ You have deleted from the Gemfile:
context "with path in Gemfile and packed" do context "with path in Gemfile and packed" do
it "works fine after bundle package and bundle install --local" do it "works fine after bundle package and bundle install --local" do
build_lib "foo", :path => lib_path("foo") build_lib "foo", :path => lib_path("foo")
install_gemfile! <<-G install_gemfile <<-G
gem "foo", :path => "#{lib_path("foo")}" gem "foo", :path => "#{lib_path("foo")}"
G G

View file

@ -75,7 +75,7 @@ RSpec.describe "bundle install with gemfile that uses eval_gemfile" do
source "#{file_uri_for(gem_repo1)}" source "#{file_uri_for(gem_repo1)}"
eval_gemfile "other/Gemfile" eval_gemfile "other/Gemfile"
G G
install_gemfile! "eval_gemfile File.expand_path('Gemfile-alt')" install_gemfile "eval_gemfile File.expand_path('Gemfile-alt')"
expect(the_bundle).to include_gem "rack 1.0.0" expect(the_bundle).to include_gem "rack 1.0.0"
end end

View file

@ -138,7 +138,7 @@ RSpec.describe "bundle install from an existing gemspec" do
s.add_dependency "rack" s.add_dependency "rack"
end end
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}" source "#{file_uri_for(gem_repo1)}"
gemspec :path => '#{tmp.join("foo")}' gemspec :path => '#{tmp.join("foo")}'
G G
@ -157,7 +157,7 @@ RSpec.describe "bundle install from an existing gemspec" do
s.add_development_dependency "thin" s.add_development_dependency "thin"
end end
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}" source "#{file_uri_for(gem_repo1)}"
gemspec :path => '#{tmp.join("foo")}' gemspec :path => '#{tmp.join("foo")}'
G G
@ -175,7 +175,7 @@ RSpec.describe "bundle install from an existing gemspec" do
system_gems "platform_specific-1.0-java", :path => default_bundle_path system_gems "platform_specific-1.0-java", :path => default_bundle_path
install_gemfile! <<-G install_gemfile <<-G
gemspec :path => '#{tmp.join("foo")}' gemspec :path => '#{tmp.join("foo")}'
G G
@ -209,7 +209,7 @@ RSpec.describe "bundle install from an existing gemspec" do
f.write "#{gemspec.strip}.tap { gem 'rack-obama'; require 'rack/obama' }" f.write "#{gemspec.strip}.tap { gem 'rack-obama'; require 'rack/obama' }"
end end
install_gemfile! <<-G install_gemfile <<-G
gemspec gemspec
G G
@ -247,7 +247,7 @@ RSpec.describe "bundle install from an existing gemspec" do
build_gem "foo", "0.0.1" build_gem "foo", "0.0.1"
end end
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo2)}" source "#{file_uri_for(gem_repo2)}"
gem "deps" gem "deps"
gemspec :path => '#{tmp.join("foo")}', :name => 'foo' gemspec :path => '#{tmp.join("foo")}', :name => 'foo'
@ -280,7 +280,7 @@ RSpec.describe "bundle install from an existing gemspec" do
s.add_dependency "activesupport", ">= 1" s.add_dependency "activesupport", ">= 1"
end end
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}" source "#{file_uri_for(gem_repo1)}"
gemspec gemspec
G G
@ -549,7 +549,7 @@ RSpec.describe "bundle install from an existing gemspec" do
it "installs the ruby platform gemspec" do it "installs the ruby platform gemspec" do
simulate_platform "ruby" simulate_platform "ruby"
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}" source "#{file_uri_for(gem_repo1)}"
gemspec :path => '#{tmp.join("foo")}', :name => 'foo' gemspec :path => '#{tmp.join("foo")}', :name => 'foo'
G G
@ -561,7 +561,7 @@ RSpec.describe "bundle install from an existing gemspec" do
simulate_platform "ruby" simulate_platform "ruby"
bundle "config --local without development" bundle "config --local without development"
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}" source "#{file_uri_for(gem_repo1)}"
gemspec :path => '#{tmp.join("foo")}', :name => 'foo' gemspec :path => '#{tmp.join("foo")}', :name => 'foo'
G G

View file

@ -225,7 +225,7 @@ RSpec.describe "bundle install with git sources" do
s.write("lib/foo.rb", "raise 'FAIL'") s.write("lib/foo.rb", "raise 'FAIL'")
end end
install_gemfile! <<-G install_gemfile <<-G
git "#{lib_path("foo-1.0")}", :ref => "refs/bundler/1" do git "#{lib_path("foo-1.0")}", :ref => "refs/bundler/1" do
gem "foo" gem "foo"
end end
@ -241,7 +241,7 @@ RSpec.describe "bundle install with git sources" do
end end
it "works when the revision is a non-head ref and it was previously downloaded" do it "works when the revision is a non-head ref and it was previously downloaded" do
install_gemfile! <<-G install_gemfile <<-G
git "#{lib_path("foo-1.0")}" do git "#{lib_path("foo-1.0")}" do
gem "foo" gem "foo"
end end
@ -259,7 +259,7 @@ RSpec.describe "bundle install with git sources" do
s.write("lib/foo.rb", "raise 'FAIL'") s.write("lib/foo.rb", "raise 'FAIL'")
end end
install_gemfile! <<-G install_gemfile <<-G
git "#{lib_path("foo-1.0")}", :ref => "refs/bundler/1" do git "#{lib_path("foo-1.0")}", :ref => "refs/bundler/1" do
gem "foo" gem "foo"
end end
@ -279,7 +279,7 @@ RSpec.describe "bundle install with git sources" do
bundle "config set global_gem_cache true" bundle "config set global_gem_cache true"
install_gemfile! <<-G install_gemfile <<-G
git "#{lib_path("foo-1.0")}" do git "#{lib_path("foo-1.0")}" do
gem "foo" gem "foo"
end end
@ -446,7 +446,7 @@ RSpec.describe "bundle install with git sources" do
s.write "lib/rack.rb", "puts :LOCAL" s.write "lib/rack.rb", "puts :LOCAL"
end end
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}" source "#{file_uri_for(gem_repo1)}"
gem "rack", :git => "#{lib_path("rack-0.8")}", :branch => "master" gem "rack", :git => "#{lib_path("rack-0.8")}", :branch => "master"
G G

View file

@ -727,7 +727,7 @@ RSpec.describe "bundle install with explicit source paths" do
s.write("lib/rubygems_plugin.rb", "FileUtils.touch('#{bar_file}')") s.write("lib/rubygems_plugin.rb", "FileUtils.touch('#{bar_file}')")
end end
install_gemfile! <<-G install_gemfile <<-G
gem "foo", :path => "#{lib_path("foo-1.0")}" gem "foo", :path => "#{lib_path("foo-1.0")}"
gem "bar", :path => "#{lib_path("bar-1.0")}" gem "bar", :path => "#{lib_path("bar-1.0")}"
G G

View file

@ -95,7 +95,7 @@ RSpec.describe "bundle install across platforms" do
simulate_platform java simulate_platform java
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo4)}" source "#{file_uri_for(gem_repo4)}"
gem "empyrean", "0.1.0" gem "empyrean", "0.1.0"
@ -242,7 +242,7 @@ RSpec.describe "bundle install across platforms" do
build_gem "CFPropertyList" build_gem "CFPropertyList"
end end
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo2)}" source "#{file_uri_for(gem_repo2)}"
gem "facter" gem "facter"

View file

@ -89,7 +89,7 @@ RSpec.describe "ruby requirement" do
end end
it "allows requirements with trailing whitespace" do it "allows requirements with trailing whitespace" do
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}" source "#{file_uri_for(gem_repo1)}"
ruby "#{RUBY_VERSION}\\n \t\\n" ruby "#{RUBY_VERSION}\\n \t\\n"
gem "rack" gem "rack"

View file

@ -544,7 +544,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
context "when a gem is installed to system gems" do context "when a gem is installed to system gems" do
before do before do
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}" source "#{file_uri_for(gem_repo1)}"
gem "rack" gem "rack"
G G
@ -590,7 +590,7 @@ RSpec.describe "bundle install with gems on multiple sources" do
describe "source changed to one containing a higher version of a dependency" do describe "source changed to one containing a higher version of a dependency" do
before do before do
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}" source "#{file_uri_for(gem_repo1)}"
gem "rack" gem "rack"

View file

@ -57,7 +57,7 @@ RSpec.describe "bundle install with specific_platform enabled" do
before { simulate_platform "x86_64-darwin-15" } before { simulate_platform "x86_64-darwin-15" }
it "locks to both the specific darwin platform and ruby" do it "locks to both the specific darwin platform and ruby" do
install_gemfile!(google_protobuf) install_gemfile(google_protobuf)
allow(Bundler::SharedHelpers).to receive(:find_gemfile).and_return(bundled_app_gemfile) allow(Bundler::SharedHelpers).to receive(:find_gemfile).and_return(bundled_app_gemfile)
expect(the_bundle.locked_gems.platforms).to eq([pl("ruby"), pl("x86_64-darwin-15")]) expect(the_bundle.locked_gems.platforms).to eq([pl("ruby"), pl("x86_64-darwin-15")])
expect(the_bundle).to include_gem("google-protobuf 3.0.0.alpha.5.0.5.1 universal-darwin") expect(the_bundle).to include_gem("google-protobuf 3.0.0.alpha.5.0.5.1 universal-darwin")
@ -75,7 +75,7 @@ RSpec.describe "bundle install with specific_platform enabled" do
end end
it "uses the platform-specific gem with extra dependencies" do it "uses the platform-specific gem with extra dependencies" do
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo2)}" source "#{file_uri_for(gem_repo2)}"
gem "facter" gem "facter"
G G
@ -94,7 +94,7 @@ RSpec.describe "bundle install with specific_platform enabled" do
end end
it "adds the foreign platform" do it "adds the foreign platform" do
install_gemfile!(google_protobuf) install_gemfile(google_protobuf)
bundle "lock --add-platform=#{x64_mingw}" bundle "lock --add-platform=#{x64_mingw}"
expect(the_bundle.locked_gems.platforms).to eq([rb, x64_mingw, pl("x86_64-darwin-15")]) expect(the_bundle.locked_gems.platforms).to eq([rb, x64_mingw, pl("x86_64-darwin-15")])
@ -106,7 +106,7 @@ RSpec.describe "bundle install with specific_platform enabled" do
end end
it "falls back on plain ruby when that version doesnt have a platform-specific gem" do it "falls back on plain ruby when that version doesnt have a platform-specific gem" do
install_gemfile!(google_protobuf) install_gemfile(google_protobuf)
bundle "lock --add-platform=#{java}" bundle "lock --add-platform=#{java}"
expect(the_bundle.locked_gems.platforms).to eq([java, rb, pl("x86_64-darwin-15")]) expect(the_bundle.locked_gems.platforms).to eq([java, rb, pl("x86_64-darwin-15")])

View file

@ -64,7 +64,7 @@ RSpec.describe "bundle install" do
context "with engine specified in symbol", :jruby do context "with engine specified in symbol", :jruby do
it "does not raise any error parsing Gemfile" do it "does not raise any error parsing Gemfile" do
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}" source "#{file_uri_for(gem_repo1)}"
ruby "#{RUBY_VERSION}", :engine => :jruby, :engine_version => "#{RUBY_ENGINE_VERSION}" ruby "#{RUBY_VERSION}", :engine => :jruby, :engine_version => "#{RUBY_ENGINE_VERSION}"
G G
@ -73,7 +73,7 @@ RSpec.describe "bundle install" do
end end
it "installation succeeds" do it "installation succeeds" do
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}" source "#{file_uri_for(gem_repo1)}"
ruby "#{RUBY_VERSION}", :engine => :jruby, :engine_version => "#{RUBY_ENGINE_VERSION}" ruby "#{RUBY_VERSION}", :engine => :jruby, :engine_version => "#{RUBY_ENGINE_VERSION}"
gem "rack" gem "rack"

View file

@ -51,7 +51,7 @@ RSpec.describe "compact index api" do
build_gem "Rack", "0.1" build_gem "Rack", "0.1"
end end
install_gemfile! <<-G, :artifice => "compact_index", :env => { "BUNDLER_SPEC_GEM_REPO" => gem_repo4.to_s } install_gemfile <<-G, :artifice => "compact_index", :env => { "BUNDLER_SPEC_GEM_REPO" => gem_repo4.to_s }
source "#{source_uri}" source "#{source_uri}"
gem "rack", "1.0" gem "rack", "1.0"
gem "Rack", "0.1" gem "Rack", "0.1"
@ -265,7 +265,7 @@ The checksum of /versions does not match the checksum provided by the server! So
#{source_uri}/info/rack #{source_uri}/info/rack
EOS EOS
install_gemfile! <<-G, :artifice => "compact_index", :verbose => true install_gemfile <<-G, :artifice => "compact_index", :verbose => true
source "#{source_uri}" source "#{source_uri}"
gem "rack" gem "rack"
G G
@ -299,7 +299,7 @@ The checksum of /versions does not match the checksum provided by the server! So
FileUtils.rm_rf Dir[gem_repo2("gems/foo-*.gem")] FileUtils.rm_rf Dir[gem_repo2("gems/foo-*.gem")]
end end
install_gemfile! <<-G, :artifice => "compact_index_extra", :verbose => true install_gemfile <<-G, :artifice => "compact_index_extra", :verbose => true
source "#{source_uri}" source "#{source_uri}"
source "#{source_uri}/extra" do source "#{source_uri}/extra" do
gem "back_deps" gem "back_deps"
@ -414,7 +414,7 @@ The checksum of /versions does not match the checksum provided by the server! So
api_request_limit = low_api_request_limit_for(gem_repo2) api_request_limit = low_api_request_limit_for(gem_repo2)
install_gemfile! <<-G, :artifice => "compact_index_extra_missing", :env => { "BUNDLER_SPEC_API_REQUEST_LIMIT" => api_request_limit.to_s }.merge(env_for_missing_prerelease_default_gem_activation) install_gemfile <<-G, :artifice => "compact_index_extra_missing", :env => { "BUNDLER_SPEC_API_REQUEST_LIMIT" => api_request_limit.to_s }.merge(env_for_missing_prerelease_default_gem_activation)
source "#{source_uri}" source "#{source_uri}"
source "#{source_uri}/extra" do source "#{source_uri}/extra" do
gem "back_deps" gem "back_deps"
@ -436,7 +436,7 @@ The checksum of /versions does not match the checksum provided by the server! So
api_request_limit = low_api_request_limit_for(gem_repo4) api_request_limit = low_api_request_limit_for(gem_repo4)
install_gemfile! <<-G, :artifice => "compact_index_extra_api_missing", :env => { "BUNDLER_SPEC_API_REQUEST_LIMIT" => api_request_limit.to_s }.merge(env_for_missing_prerelease_default_gem_activation) install_gemfile <<-G, :artifice => "compact_index_extra_api_missing", :env => { "BUNDLER_SPEC_API_REQUEST_LIMIT" => api_request_limit.to_s }.merge(env_for_missing_prerelease_default_gem_activation)
source "#{source_uri}" source "#{source_uri}"
source "#{source_uri}/extra" do source "#{source_uri}/extra" do
gem "back_deps" gem "back_deps"
@ -898,7 +898,7 @@ The checksum of /versions does not match the checksum provided by the server! So
it "does not raise when disable_checksum_validation is set" do it "does not raise when disable_checksum_validation is set" do
bundle "config set disable_checksum_validation true" bundle "config set disable_checksum_validation true"
install_gemfile! <<-G, :artifice => "compact_index_wrong_gem_checksum" install_gemfile <<-G, :artifice => "compact_index_wrong_gem_checksum"
source "#{source_uri}" source "#{source_uri}"
gem "rack" gem "rack"
G G
@ -906,7 +906,7 @@ The checksum of /versions does not match the checksum provided by the server! So
end end
it "works when cache dir is world-writable" do it "works when cache dir is world-writable" do
install_gemfile! <<-G, :artifice => "compact_index" install_gemfile <<-G, :artifice => "compact_index"
File.umask(0000) File.umask(0000)
source "#{source_uri}" source "#{source_uri}"
gem "rack" gem "rack"
@ -930,7 +930,7 @@ Either installing with `--full-index` or running `bundle update rails` should fi
end end
it "does not duplicate specs in the lockfile when updating and a dependency is not installed" do it "does not duplicate specs in the lockfile when updating and a dependency is not installed" do
install_gemfile! <<-G, :artifice => "compact_index" install_gemfile <<-G, :artifice => "compact_index"
source "#{source_uri}" do source "#{source_uri}" do
gem "rails" gem "rails"
gem "activemerchant" gem "activemerchant"

View file

@ -388,7 +388,7 @@ RSpec.describe "gemcutter's dependency API" do
api_request_limit = low_api_request_limit_for(gem_repo2) api_request_limit = low_api_request_limit_for(gem_repo2)
install_gemfile! <<-G, :artifice => "endpoint_extra_missing", :env => { "BUNDLER_SPEC_API_REQUEST_LIMIT" => api_request_limit.to_s }.merge(env_for_missing_prerelease_default_gem_activation) install_gemfile <<-G, :artifice => "endpoint_extra_missing", :env => { "BUNDLER_SPEC_API_REQUEST_LIMIT" => api_request_limit.to_s }.merge(env_for_missing_prerelease_default_gem_activation)
source "#{source_uri}" source "#{source_uri}"
source "#{source_uri}/extra" source "#{source_uri}/extra"
gem "back_deps" gem "back_deps"
@ -409,7 +409,7 @@ RSpec.describe "gemcutter's dependency API" do
api_request_limit = low_api_request_limit_for(gem_repo2) api_request_limit = low_api_request_limit_for(gem_repo2)
install_gemfile! <<-G, :artifice => "endpoint_extra_missing", :env => { "BUNDLER_SPEC_API_REQUEST_LIMIT" => api_request_limit.to_s }.merge(env_for_missing_prerelease_default_gem_activation) install_gemfile <<-G, :artifice => "endpoint_extra_missing", :env => { "BUNDLER_SPEC_API_REQUEST_LIMIT" => api_request_limit.to_s }.merge(env_for_missing_prerelease_default_gem_activation)
source "#{source_uri}" source "#{source_uri}"
source "#{source_uri}/extra" do source "#{source_uri}/extra" do
gem "back_deps" gem "back_deps"

View file

@ -248,11 +248,11 @@ RSpec.describe "bundle flex_install" do
describe "when adding a new source" do describe "when adding a new source" do
it "updates the lockfile", :bundler => "< 3" do it "updates the lockfile", :bundler => "< 3" do
build_repo2 build_repo2
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}" source "#{file_uri_for(gem_repo1)}"
gem "rack" gem "rack"
G G
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}" source "#{file_uri_for(gem_repo1)}"
source "#{file_uri_for(gem_repo2)}" source "#{file_uri_for(gem_repo2)}"
gem "rack" gem "rack"
@ -278,12 +278,12 @@ RSpec.describe "bundle flex_install" do
it "updates the lockfile", :bundler => "3" do it "updates the lockfile", :bundler => "3" do
build_repo2 build_repo2
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}" source "#{file_uri_for(gem_repo1)}"
gem "rack" gem "rack"
G G
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}" source "#{file_uri_for(gem_repo1)}"
source "#{file_uri_for(gem_repo2)}" do source "#{file_uri_for(gem_repo2)}" do
end end

View file

@ -77,7 +77,7 @@ RSpec.describe "installing a gem with native extensions", :ruby_repo do
bundle "config set build.c_extension --with-c_extension=hello" bundle "config set build.c_extension --with-c_extension=hello"
install_gemfile! <<-G install_gemfile <<-G
gem "c_extension", :git => #{lib_path("c_extension-1.0").to_s.dump} gem "c_extension", :git => #{lib_path("c_extension-1.0").to_s.dump}
G G
@ -125,12 +125,12 @@ RSpec.describe "installing a gem with native extensions", :ruby_repo do
bundle "config set build.c_extension_two --with-c_extension_two=two" bundle "config set build.c_extension_two --with-c_extension_two=two"
# 1st time, require only one gem -- only one of the extensions gets built. # 1st time, require only one gem -- only one of the extensions gets built.
install_gemfile! <<-G install_gemfile <<-G
gem "c_extension_one", :git => #{lib_path("gems").to_s.dump} gem "c_extension_one", :git => #{lib_path("gems").to_s.dump}
G G
# 2nd time, require both gems -- we need both extensions to be built now. # 2nd time, require both gems -- we need both extensions to be built now.
install_gemfile! <<-G install_gemfile <<-G
gem "c_extension_one", :git => #{lib_path("gems").to_s.dump} gem "c_extension_one", :git => #{lib_path("gems").to_s.dump}
gem "c_extension_two", :git => #{lib_path("gems").to_s.dump} gem "c_extension_two", :git => #{lib_path("gems").to_s.dump}
G G
@ -170,7 +170,7 @@ RSpec.describe "installing a gem with native extensions", :ruby_repo do
bundle "config set build.c_extension --with-c_extension=hello --with-c_extension_bundle-dir=hola" bundle "config set build.c_extension --with-c_extension=hello --with-c_extension_bundle-dir=hola"
install_gemfile! <<-G install_gemfile <<-G
gem "c_extension", :git => #{lib_path("c_extension-1.0").to_s.dump} gem "c_extension", :git => #{lib_path("c_extension-1.0").to_s.dump}
G G

View file

@ -5,7 +5,7 @@ RSpec.describe "bundle install" do
it "displays the revision hash of the gem repository", :bundler => "< 3" do it "displays the revision hash of the gem repository", :bundler => "< 3" do
build_git "foo", "1.0", :path => lib_path("foo") build_git "foo", "1.0", :path => lib_path("foo")
install_gemfile! <<-G install_gemfile <<-G
gem "foo", :git => "#{file_uri_for(lib_path("foo"))}" gem "foo", :git => "#{file_uri_for(lib_path("foo"))}"
G G
@ -22,7 +22,7 @@ RSpec.describe "bundle install" do
rev2 = revision_for(lib_path("foo"))[0..6] rev2 = revision_for(lib_path("foo"))[0..6]
update_git "foo", "3.0", :path => lib_path("foo"), :gemspec => true update_git "foo", "3.0", :path => lib_path("foo"), :gemspec => true
install_gemfile! <<-G install_gemfile <<-G
gem "foo", :git => "#{file_uri_for(lib_path("foo"))}", :ref => "master~2" gem "foo", :git => "#{file_uri_for(lib_path("foo"))}", :ref => "master~2"
G G
@ -71,7 +71,7 @@ RSpec.describe "bundle install" do
build_git "gems", :path => lib_path("gems"), :gemspec => false build_git "gems", :path => lib_path("gems"), :gemspec => false
end end
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo2)}" source "#{file_uri_for(gem_repo2)}"
gem "foo", :git => "#{file_uri_for(lib_path("gems"))}", :glob => "foo/*.gemspec" gem "foo", :git => "#{file_uri_for(lib_path("gems"))}", :glob => "foo/*.gemspec"
gem "zebra", :git => "#{file_uri_for(lib_path("gems"))}", :glob => "zebra/*.gemspec" gem "zebra", :git => "#{file_uri_for(lib_path("gems"))}", :glob => "zebra/*.gemspec"

View file

@ -16,7 +16,7 @@ RSpec.describe "global gem caching" do
end end
it "caches gems into the global cache on download" do it "caches gems into the global cache on download" do
install_gemfile! <<-G, :artifice => "compact_index" install_gemfile <<-G, :artifice => "compact_index"
source "#{source}" source "#{source}"
gem "rack" gem "rack"
G G
@ -29,7 +29,7 @@ RSpec.describe "global gem caching" do
source_global_cache.mkpath source_global_cache.mkpath
FileUtils.cp(gem_repo1("gems/rack-1.0.0.gem"), source_global_cache("rack-1.0.0.gem")) FileUtils.cp(gem_repo1("gems/rack-1.0.0.gem"), source_global_cache("rack-1.0.0.gem"))
install_gemfile! <<-G, :artifice => "compact_index_no_gem" install_gemfile <<-G, :artifice => "compact_index_no_gem"
source "#{source}" source "#{source}"
gem "rack" gem "rack"
G G
@ -39,7 +39,7 @@ RSpec.describe "global gem caching" do
describe "when the same gem from different sources is installed" do describe "when the same gem from different sources is installed" do
it "should use the appropriate one from the global cache" do it "should use the appropriate one from the global cache" do
install_gemfile! <<-G, :artifice => "compact_index" install_gemfile <<-G, :artifice => "compact_index"
source "#{source}" source "#{source}"
gem "rack" gem "rack"
G G
@ -49,7 +49,7 @@ RSpec.describe "global gem caching" do
expect(source_global_cache("rack-1.0.0.gem")).to exist expect(source_global_cache("rack-1.0.0.gem")).to exist
# rack 1.0.0 is not installed and it is in the global cache # rack 1.0.0 is not installed and it is in the global cache
install_gemfile! <<-G, :artifice => "compact_index" install_gemfile <<-G, :artifice => "compact_index"
source "#{source2}" source "#{source2}"
gem "rack", "0.9.1" gem "rack", "0.9.1"
G G
@ -134,7 +134,7 @@ RSpec.describe "global gem caching" do
describe "when installing gems from a different directory" do describe "when installing gems from a different directory" do
it "uses the global cache as a source" do it "uses the global cache as a source" do
install_gemfile! <<-G, :artifice => "compact_index" install_gemfile <<-G, :artifice => "compact_index"
source "#{source}" source "#{source}"
gem "rack" gem "rack"
gem "activesupport" gem "activesupport"
@ -150,7 +150,7 @@ RSpec.describe "global gem caching" do
expect(the_bundle).not_to include_gems "rack 1.0.0" expect(the_bundle).not_to include_gems "rack 1.0.0"
expect(the_bundle).not_to include_gems "activesupport 2.3.5" expect(the_bundle).not_to include_gems "activesupport 2.3.5"
install_gemfile! <<-G, :artifice => "compact_index_no_gem" install_gemfile <<-G, :artifice => "compact_index_no_gem"
source "#{source}" source "#{source}"
gem "rack" gem "rack"
G G
@ -193,7 +193,7 @@ RSpec.describe "global gem caching" do
build_lib "very_simple_path_binary", &:add_c_extension build_lib "very_simple_path_binary", &:add_c_extension
revision = revision_for(lib_path("very_simple_git_binary-1.0"))[0, 12] revision = revision_for(lib_path("very_simple_git_binary-1.0"))[0, 12]
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}" source "#{file_uri_for(gem_repo1)}"
gem "very_simple_binary" gem "very_simple_binary"

View file

@ -12,7 +12,7 @@ RSpec.describe "process lock spec" do
end end
end end
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}" source "#{file_uri_for(gem_repo1)}"
gem "rack" gem "rack"
G G

View file

@ -620,7 +620,7 @@ RSpec.describe "the lockfile format" do
it "serializes pinned path sources to the lockfile even when packaging" do it "serializes pinned path sources to the lockfile even when packaging" do
build_lib "foo" build_lib "foo"
install_gemfile! <<-G install_gemfile <<-G
gem "foo", :path => "#{lib_path("foo-1.0")}" gem "foo", :path => "#{lib_path("foo-1.0")}"
G G
@ -1048,7 +1048,7 @@ RSpec.describe "the lockfile format" do
simulate_platform "universal-java-16" simulate_platform "universal-java-16"
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo2)}" source "#{file_uri_for(gem_repo2)}"
gem "platform_specific" gem "platform_specific"
G G
@ -1079,7 +1079,7 @@ RSpec.describe "the lockfile format" do
simulate_platform "universal-java-16" simulate_platform "universal-java-16"
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo2)}" source "#{file_uri_for(gem_repo2)}"
gem "platform_specific" gem "platform_specific"
G G

View file

@ -5,7 +5,7 @@ RSpec.describe "major deprecations" do
describe "Bundler" do describe "Bundler" do
before do before do
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}" source "#{file_uri_for(gem_repo1)}"
gem "rack" gem "rack"
G G
@ -290,7 +290,7 @@ RSpec.describe "major deprecations" do
it "should print a proper warning, and use gems.rb" do it "should print a proper warning, and use gems.rb" do
create_file "gems.rb" create_file "gems.rb"
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}" source "#{file_uri_for(gem_repo1)}"
gem "rack" gem "rack"
G G
@ -374,7 +374,7 @@ RSpec.describe "major deprecations" do
context "when Bundler.setup is run in a ruby script" do context "when Bundler.setup is run in a ruby script" do
before do before do
create_file "gems.rb" create_file "gems.rb"
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}" source "#{file_uri_for(gem_repo1)}"
gem "rack", :group => :test gem "rack", :group => :test
G G
@ -482,7 +482,7 @@ The :gist git source is deprecated, and will be removed in the future. Add this
context "bundle show" do context "bundle show" do
before do before do
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}" source "#{file_uri_for(gem_repo1)}"
gem "rack" gem "rack"
G G

View file

@ -594,7 +594,7 @@ G
end end
it "prints path if ruby version is correct" do it "prints path if ruby version is correct" do
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}" source "#{file_uri_for(gem_repo1)}"
gem "rails" gem "rails"
@ -606,7 +606,7 @@ G
end end
it "prints path if ruby version is correct for any engine", :jruby do it "prints path if ruby version is correct for any engine", :jruby do
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}" source "#{file_uri_for(gem_repo1)}"
gem "rails" gem "rails"
@ -689,7 +689,7 @@ G
end end
it "copies the .gem file to vendor/cache when ruby version matches for any engine", :jruby do it "copies the .gem file to vendor/cache when ruby version matches for any engine", :jruby do
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}" source "#{file_uri_for(gem_repo1)}"
gem 'rack' gem 'rack'
@ -748,7 +748,7 @@ G
context "bundle pack" do context "bundle pack" do
before do before do
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}" source "#{file_uri_for(gem_repo1)}"
gem 'rack' gem 'rack'
G G
@ -766,7 +766,7 @@ G
end end
it "copies the .gem file to vendor/cache when ruby version matches any engine", :jruby do it "copies the .gem file to vendor/cache when ruby version matches any engine", :jruby do
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}" source "#{file_uri_for(gem_repo1)}"
gem 'rack' gem 'rack'

View file

@ -210,13 +210,13 @@ RSpec.describe "bundler plugin install" do
context "in deployment mode" do context "in deployment mode" do
it "installs plugins" do it "installs plugins" do
install_gemfile! <<-G install_gemfile <<-G
source '#{file_uri_for(gem_repo2)}' source '#{file_uri_for(gem_repo2)}'
gem 'rack', "1.0.0" gem 'rack', "1.0.0"
G G
bundle "config --local deployment true" bundle "config --local deployment true"
install_gemfile! <<-G install_gemfile <<-G
source '#{file_uri_for(gem_repo2)}' source '#{file_uri_for(gem_repo2)}'
plugin 'foo' plugin 'foo'
gem 'rack', "1.0.0" gem 'rack', "1.0.0"

View file

@ -34,7 +34,7 @@ RSpec.describe "gemcutter's dependency API", :realworld => true do
end end
it "times out and falls back on the modern index" do it "times out and falls back on the modern index" do
install_gemfile! <<-G, :artifice => nil install_gemfile <<-G, :artifice => nil
source "#{@server_uri}" source "#{@server_uri}"
gem "rack" gem "rack"
G G

View file

@ -2,7 +2,7 @@
RSpec.describe "Running bin/* commands" do RSpec.describe "Running bin/* commands" do
before :each do before :each do
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}" source "#{file_uri_for(gem_repo1)}"
gem "rack" gem "rack"
G G
@ -140,7 +140,7 @@ RSpec.describe "Running bin/* commands" do
end end
it "rewrites bins on binstubs (to maintain backwards compatibility)" do it "rewrites bins on binstubs (to maintain backwards compatibility)" do
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}" source "#{file_uri_for(gem_repo1)}"
gem "rack" gem "rack"
G G

View file

@ -19,7 +19,7 @@ RSpec.describe "require 'bundler/gem_tasks'" do
RAKEFILE RAKEFILE
end end
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}" source "#{file_uri_for(gem_repo1)}"
gem "rake" gem "rake"
@ -74,7 +74,7 @@ RSpec.describe "require 'bundler/gem_tasks'" do
end end
it "works", :ruby_repo do it "works", :ruby_repo do
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}" source "#{file_uri_for(gem_repo1)}"
gem "rake" gem "rake"

View file

@ -3,7 +3,7 @@
RSpec.describe "Bundler.load" do RSpec.describe "Bundler.load" do
describe "with a gemfile" do describe "with a gemfile" do
before(:each) do before(:each) do
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}" source "#{file_uri_for(gem_repo1)}"
gem "rack" gem "rack"
G G
@ -75,7 +75,7 @@ RSpec.describe "Bundler.load" do
describe "when called twice" do describe "when called twice" do
it "doesn't try to load the runtime twice" do it "doesn't try to load the runtime twice" do
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}" source "#{file_uri_for(gem_repo1)}"
gem "rack" gem "rack"
gem "activesupport", :group => :test gem "activesupport", :group => :test
@ -99,7 +99,7 @@ RSpec.describe "Bundler.load" do
describe "not hurting brittle rubygems" do describe "not hurting brittle rubygems" do
it "does not inject #source into the generated YAML of the gem specs" do it "does not inject #source into the generated YAML of the gem specs" do
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}" source "#{file_uri_for(gem_repo1)}"
gem "activerecord" gem "activerecord"
G G

View file

@ -49,7 +49,7 @@ RSpec.describe "Bundler.setup with multi platform stuff" do
G G
simulate_platform "x86-darwin-10" simulate_platform "x86-darwin-10"
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}" source "#{file_uri_for(gem_repo1)}"
gem "nokogiri" gem "nokogiri"
G G
@ -75,7 +75,7 @@ RSpec.describe "Bundler.setup with multi platform stuff" do
simulate_platform "x86-darwin-100" simulate_platform "x86-darwin-100"
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}" source "#{file_uri_for(gem_repo1)}"
gem "nokogiri" gem "nokogiri"
gem "platform_specific" gem "platform_specific"
@ -87,7 +87,7 @@ RSpec.describe "Bundler.setup with multi platform stuff" do
it "allows specifying only-ruby-platform" do it "allows specifying only-ruby-platform" do
simulate_platform "java" simulate_platform "java"
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}" source "#{file_uri_for(gem_repo1)}"
gem "nokogiri" gem "nokogiri"
gem "platform_specific" gem "platform_specific"
@ -102,7 +102,7 @@ RSpec.describe "Bundler.setup with multi platform stuff" do
it "allows specifying only-ruby-platform on windows with dependency platforms" do it "allows specifying only-ruby-platform on windows with dependency platforms" do
simulate_windows do simulate_windows do
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}" source "#{file_uri_for(gem_repo1)}"
gem "nokogiri", :platforms => [:mingw, :mswin, :x64_mingw, :jruby] gem "nokogiri", :platforms => [:mingw, :mswin, :x64_mingw, :jruby]
gem "platform_specific" gem "platform_specific"
@ -159,7 +159,7 @@ RSpec.describe "Bundler.setup with multi platform stuff" do
requires_platform_specific requires_platform_specific
L L
install_gemfile! <<-G, :verbose => true install_gemfile <<-G, :verbose => true
source "#{file_uri_for(gem_repo2)}" source "#{file_uri_for(gem_repo2)}"
gem "requires_platform_specific" gem "requires_platform_specific"
G G

View file

@ -370,7 +370,7 @@ RSpec.describe "Bundler.require" do
end end
it "does not load rubygems gemspecs that are used" do it "does not load rubygems gemspecs that are used" do
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}" source "#{file_uri_for(gem_repo1)}"
gem "rack" gem "rack"
G G
@ -395,7 +395,7 @@ RSpec.describe "Bundler.require" do
it "does not load git gemspecs that are used" do it "does not load git gemspecs that are used" do
build_git "foo" build_git "foo"
install_gemfile! <<-G install_gemfile <<-G
gem "foo", :git => "#{lib_path("foo-1.0")}" gem "foo", :git => "#{lib_path("foo-1.0")}"
G G

View file

@ -164,7 +164,7 @@ RSpec.describe "Bundler.setup" do
end end
it "falls back to order the load path alphabetically for backwards compatibility" do it "falls back to order the load path alphabetically for backwards compatibility" do
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}" source "#{file_uri_for(gem_repo1)}"
gem "weakling" gem "weakling"
gem "duradura" gem "duradura"
@ -665,7 +665,7 @@ RSpec.describe "Bundler.setup" do
end end
it "does not load all gemspecs" do it "does not load all gemspecs" do
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}" source "#{file_uri_for(gem_repo1)}"
gem "rack" gem "rack"
G G
@ -717,7 +717,7 @@ end
before { ENV["MANPATH"] = "/foo#{File::PATH_SEPARATOR}" } before { ENV["MANPATH"] = "/foo#{File::PATH_SEPARATOR}" }
it "adds the gem's man dir to the MANPATH" do it "adds the gem's man dir to the MANPATH" do
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo4)}" source "#{file_uri_for(gem_repo4)}"
gem "with_man" gem "with_man"
G G
@ -731,7 +731,7 @@ end
before { ENV.delete("MANPATH") } before { ENV.delete("MANPATH") }
it "adds the gem's man dir to the MANPATH" do it "adds the gem's man dir to the MANPATH" do
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo4)}" source "#{file_uri_for(gem_repo4)}"
gem "with_man" gem "with_man"
G G
@ -1194,7 +1194,7 @@ end
end end
it "does not load openssl" do it "does not load openssl" do
install_gemfile! "" install_gemfile ""
ruby! <<-RUBY ruby! <<-RUBY
require "#{lib_dir}/bundler/setup" require "#{lib_dir}/bundler/setup"
puts defined?(OpenSSL) || "undefined" puts defined?(OpenSSL) || "undefined"
@ -1250,13 +1250,13 @@ end
RUBY RUBY
it "activates no gems with -rbundler/setup" do it "activates no gems with -rbundler/setup" do
install_gemfile! "" install_gemfile ""
ruby! code, :env => { "RUBYOPT" => activation_warning_hack_rubyopt + " -r#{lib_dir}/bundler/setup" } ruby! code, :env => { "RUBYOPT" => activation_warning_hack_rubyopt + " -r#{lib_dir}/bundler/setup" }
expect(out).to eq("{}") expect(out).to eq("{}")
end end
it "activates no gems with bundle exec" do it "activates no gems with bundle exec" do
install_gemfile! "" install_gemfile ""
create_file("script.rb", code) create_file("script.rb", code)
bundle "exec ruby ./script.rb", :env => { "RUBYOPT" => activation_warning_hack_rubyopt } bundle "exec ruby ./script.rb", :env => { "RUBYOPT" => activation_warning_hack_rubyopt }
expect(out).to eq("{}") expect(out).to eq("{}")
@ -1265,7 +1265,7 @@ end
it "activates no gems with bundle exec that is loaded" do it "activates no gems with bundle exec that is loaded" do
skip "not executable" if Gem.win_platform? skip "not executable" if Gem.win_platform?
install_gemfile! "" install_gemfile ""
create_file("script.rb", "#!/usr/bin/env ruby\n\n#{code}") create_file("script.rb", "#!/usr/bin/env ruby\n\n#{code}")
FileUtils.chmod(0o777, bundled_app("script.rb")) FileUtils.chmod(0o777, bundled_app("script.rb"))
bundle "exec ./script.rb", :artifice => nil, :env => { "RUBYOPT" => activation_warning_hack_rubyopt } bundle "exec ./script.rb", :artifice => nil, :env => { "RUBYOPT" => activation_warning_hack_rubyopt }
@ -1324,7 +1324,7 @@ end
build_gem g, "999999" build_gem g, "999999"
end end
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo4)}" source "#{file_uri_for(gem_repo4)}"
gem "#{g}", "999999" gem "#{g}", "999999"
G G
@ -1340,7 +1340,7 @@ end
build_gem g, "0.0.0.a" build_gem g, "0.0.0.a"
end end
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo4)}" source "#{file_uri_for(gem_repo4)}"
gem "#{g}", "0.0.0.a" gem "#{g}", "0.0.0.a"
G G
@ -1369,7 +1369,7 @@ end
end end
it "keeps Kernel#gem private", :bundler => "3" do it "keeps Kernel#gem private", :bundler => "3" do
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}" source "#{file_uri_for(gem_repo1)}"
gem "rack" gem "rack"
G G
@ -1385,7 +1385,7 @@ end
end end
it "keeps Kernel#require private" do it "keeps Kernel#require private" do
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}" source "#{file_uri_for(gem_repo1)}"
gem "rack" gem "rack"
G G

View file

@ -27,7 +27,7 @@ RSpec.describe "bundle update" do
s.add_dependency "activesupport", "= 3.0" s.add_dependency "activesupport", "= 3.0"
end end
install_gemfile! <<-G install_gemfile <<-G
gem "rails", :git => "#{lib_path("rails")}" gem "rails", :git => "#{lib_path("rails")}"
G G
@ -158,7 +158,7 @@ RSpec.describe "bundle update" do
end end
it "unlocks the source when submodules are removed from git source", :git => ">= 2.9.0" do it "unlocks the source when submodules are removed from git source", :git => ">= 2.9.0" do
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo4)}" source "#{file_uri_for(gem_repo4)}"
git "#{lib_path("has_submodule-1.0")}", :submodules => true do git "#{lib_path("has_submodule-1.0")}", :submodules => true do
gem "has_submodule" gem "has_submodule"
@ -168,7 +168,7 @@ RSpec.describe "bundle update" do
run! "require 'submodule'" run! "require 'submodule'"
expect(out).to eq("GIT") expect(out).to eq("GIT")
install_gemfile! <<-G install_gemfile <<-G
source "#{file_uri_for(gem_repo4)}" source "#{file_uri_for(gem_repo4)}"
git "#{lib_path("has_submodule-1.0")}" do git "#{lib_path("has_submodule-1.0")}" do
gem "has_submodule" gem "has_submodule"