aboutsummaryrefslogtreecommitdiffstats
path: root/spec/bundler/realworld
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-11-01 23:29:38 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-11-01 23:29:38 +0000
commitbe7b5929126cb3e696ef222339237faba9b8fe5a (patch)
tree51eae376f93c09bc82dde5a657a91df2c89062e4 /spec/bundler/realworld
parentae49dbd392083f69026f2a0fff4a1d5f42d172a7 (diff)
downloadruby-be7b5929126cb3e696ef222339237faba9b8fe5a.tar.gz
Update bundled bundler to 1.16.0.
* lib/bundler, spec/bundler: Merge bundler-1.16.0. * common.mk: rspec examples of bundler-1.16.0 needs require option. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60603 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'spec/bundler/realworld')
-rw-r--r--spec/bundler/realworld/dependency_api_spec.rb9
-rw-r--r--spec/bundler/realworld/edgecases_spec.rb48
-rw-r--r--spec/bundler/realworld/gemfile_source_header_spec.rb4
-rw-r--r--spec/bundler/realworld/mirror_probe_spec.rb19
-rw-r--r--spec/bundler/realworld/parallel_spec.rb17
5 files changed, 43 insertions, 54 deletions
diff --git a/spec/bundler/realworld/dependency_api_spec.rb b/spec/bundler/realworld/dependency_api_spec.rb
index 468fa3644c..13527ce5d1 100644
--- a/spec/bundler/realworld/dependency_api_spec.rb
+++ b/spec/bundler/realworld/dependency_api_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "gemcutter's dependency API", :realworld => true do
context "when Gemcutter API takes too long to respond" do
@@ -23,6 +22,7 @@ RSpec.describe "gemcutter's dependency API", :realworld => true do
@t.run
wait_for_server("127.0.0.1", port)
+ bundle! "config timeout 1"
end
after do
@@ -32,16 +32,11 @@ RSpec.describe "gemcutter's dependency API", :realworld => true do
end
it "times out and falls back on the modern index" do
- gemfile <<-G
+ install_gemfile! <<-G, :artifice => nil
source "#{@server_uri}"
gem "rack"
-
- old_v, $VERBOSE = $VERBOSE, nil
- Bundler::Fetcher.api_timeout = 1
- $VERBOSE = old_v
G
- bundle :install
expect(out).to include("Fetching source index from #{@server_uri}/")
expect(the_bundle).to include_gems "rack 1.0.0"
end
diff --git a/spec/bundler/realworld/edgecases_spec.rb b/spec/bundler/realworld/edgecases_spec.rb
index 302fd57cf0..aa60e20b8a 100644
--- a/spec/bundler/realworld/edgecases_spec.rb
+++ b/spec/bundler/realworld/edgecases_spec.rb
@@ -1,19 +1,22 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "real world edgecases", :realworld => true, :sometimes => true do
def rubygems_version(name, requirement)
- require "bundler/source/rubygems/remote"
- require "bundler/fetcher"
- source = Bundler::Source::Rubygems::Remote.new(URI("https://rubygems.org"))
- fetcher = Bundler::Fetcher.new(source)
- index = fetcher.specs([name], nil)
- rubygem = index.search(Gem::Dependency.new(name, requirement)).last
- if rubygem.nil?
- raise "Could not find #{name} (#{requirement}) on rubygems.org!\n" \
- "Found specs:\n#{index.send(:specs).inspect}"
- end
- "#{name} (#{rubygem.version})"
+ ruby! <<-RUBY
+ require #{File.expand_path("../../support/artifice/vcr.rb", __FILE__).dump}
+ require "bundler"
+ require "bundler/source/rubygems/remote"
+ require "bundler/fetcher"
+ source = Bundler::Source::Rubygems::Remote.new(URI("https://rubygems.org"))
+ fetcher = Bundler::Fetcher.new(source)
+ index = fetcher.specs([#{name.dump}], nil)
+ rubygem = index.search(Gem::Dependency.new(#{name.dump}, #{requirement.dump})).last
+ if rubygem.nil?
+ raise "Could not find #{name} (#{requirement}) on rubygems.org!\n" \
+ "Found specs:\n\#{index.send(:specs).inspect}"
+ end
+ "#{name} (\#{rubygem.version})"
+ RUBY
end
# there is no rbx-relative-require gem that will install on 1.9
@@ -76,7 +79,7 @@ RSpec.describe "real world edgecases", :realworld => true, :sometimes => true do
gem "gxapi_rails", "< 0.1.0" # 0.1.0 was released way after the test was written
gem 'rack-cache', '1.2.0' # last version that works on Ruby 1.9
G
- bundle :lock
+ bundle! :lock
expect(lockfile).to include("gxapi_rails (0.0.6)")
end
@@ -89,7 +92,7 @@ RSpec.describe "real world edgecases", :realworld => true, :sometimes => true do
gem "activerecord", "~> 3.0"
gem "builder", "~> 2.1.2"
G
- bundle :lock
+ bundle! :lock
expect(lockfile).to include(rubygems_version("i18n", "~> 0.6.0"))
expect(lockfile).to include(rubygems_version("activesupport", "~> 3.0"))
end
@@ -220,9 +223,6 @@ RSpec.describe "real world edgecases", :realworld => true, :sometimes => true do
DEPENDENCIES
paperclip (~> 5.1.0)
rails (~> 4.2.7.1)
-
- BUNDLED WITH
- 1.13.1
L
bundle! "lock --update paperclip"
@@ -239,7 +239,7 @@ RSpec.describe "real world edgecases", :realworld => true, :sometimes => true do
gem 'rack', '1.0.1'
G
- bundle "install --path vendor/bundle"
+ bundle! :install, forgotten_command_line_options(:path => "vendor/bundle")
expect(err).not_to include("Could not find rake")
expect(err).to lack_errors
end
@@ -247,6 +247,7 @@ RSpec.describe "real world edgecases", :realworld => true, :sometimes => true do
it "checks out git repos when the lockfile is corrupted" do
gemfile <<-G
source "https://rubygems.org"
+ git_source(:github) {|repo| "https://github.com/\#{repo}.git" }
gem 'activerecord', :github => 'carlhuda/rails-bundler-test', :branch => 'master'
gem 'activesupport', :github => 'carlhuda/rails-bundler-test', :branch => 'master'
@@ -255,7 +256,7 @@ RSpec.describe "real world edgecases", :realworld => true, :sometimes => true do
lockfile <<-L
GIT
- remote: git://github.com/carlhuda/rails-bundler-test.git
+ remote: https://github.com/carlhuda/rails-bundler-test.git
revision: 369e28a87419565f1940815219ea9200474589d4
branch: master
specs:
@@ -282,7 +283,7 @@ RSpec.describe "real world edgecases", :realworld => true, :sometimes => true do
multi_json (~> 1.0)
GIT
- remote: git://github.com/carlhuda/rails-bundler-test.git
+ remote: https://github.com/carlhuda/rails-bundler-test.git
revision: 369e28a87419565f1940815219ea9200474589d4
branch: master
specs:
@@ -309,7 +310,7 @@ RSpec.describe "real world edgecases", :realworld => true, :sometimes => true do
multi_json (~> 1.0)
GIT
- remote: git://github.com/carlhuda/rails-bundler-test.git
+ remote: https://github.com/carlhuda/rails-bundler-test.git
revision: 369e28a87419565f1940815219ea9200474589d4
branch: master
specs:
@@ -366,9 +367,8 @@ RSpec.describe "real world edgecases", :realworld => true, :sometimes => true do
activesupport!
L
- bundle :lock
- expect(err).to eq("")
- expect(exitstatus).to eq(0) if exitstatus
+ bundle! :lock
+ expect(last_command.stderr).to lack_errors
end
it "outputs a helpful error message when gems have invalid gemspecs" do
diff --git a/spec/bundler/realworld/gemfile_source_header_spec.rb b/spec/bundler/realworld/gemfile_source_header_spec.rb
index ba888d43bd..59c1916874 100644
--- a/spec/bundler/realworld/gemfile_source_header_spec.rb
+++ b/spec/bundler/realworld/gemfile_source_header_spec.rb
@@ -1,5 +1,5 @@
# frozen_string_literal: true
-require "spec_helper"
+
require "thread"
RSpec.describe "fetching dependencies with a mirrored source", :realworld => true, :rubygems => ">= 2.0" do
@@ -23,7 +23,7 @@ RSpec.describe "fetching dependencies with a mirrored source", :realworld => tru
gem 'weakling'
G
- bundle :install
+ bundle :install, :artifice => nil
expect(out).to include("Installing weakling")
expect(out).to include("Bundle complete")
diff --git a/spec/bundler/realworld/mirror_probe_spec.rb b/spec/bundler/realworld/mirror_probe_spec.rb
index 93dca0c173..ab74886329 100644
--- a/spec/bundler/realworld/mirror_probe_spec.rb
+++ b/spec/bundler/realworld/mirror_probe_spec.rb
@@ -1,5 +1,5 @@
# frozen_string_literal: true
-require "spec_helper"
+
require "thread"
RSpec.describe "fetching dependencies with a not available mirror", :realworld => true do
@@ -32,7 +32,7 @@ RSpec.describe "fetching dependencies with a not available mirror", :realworld =
gem 'weakling'
G
- bundle :install
+ bundle :install, :artifice => nil
expect(out).to include("Installing weakling")
expect(out).to include("Bundle complete")
@@ -52,7 +52,7 @@ RSpec.describe "fetching dependencies with a not available mirror", :realworld =
gem 'weakling'
G
- bundle :install
+ bundle :install, :artifice => nil
expect(out).to include("Installing weakling")
expect(out).to include("Bundle complete")
@@ -71,7 +71,7 @@ RSpec.describe "fetching dependencies with a not available mirror", :realworld =
gem 'weakling'
G
- bundle :install
+ bundle :install, :artifice => nil
expect(out).to include("Fetching source index from #{mirror}")
expect(out).to include("Retrying fetcher due to error (2/4): Bundler::HTTPError Could not fetch specs from #{mirror}")
@@ -86,14 +86,15 @@ RSpec.describe "fetching dependencies with a not available mirror", :realworld =
gem 'weakling'
G
- bundle :install
-
- expect(out).to eq "Fetching source index from #{mirror}/
+ bundle :install, :artifice => nil
+ expect(last_command.stdout).to include "Fetching source index from #{mirror}/"
+ expect(last_command.bundler_err).to include <<-EOS.strip
Retrying fetcher due to error (2/4): Bundler::HTTPError Could not fetch specs from #{mirror}/
Retrying fetcher due to error (3/4): Bundler::HTTPError Could not fetch specs from #{mirror}/
Retrying fetcher due to error (4/4): Bundler::HTTPError Could not fetch specs from #{mirror}/
-Could not fetch specs from #{mirror}/"
+Could not fetch specs from #{mirror}/
+ EOS
end
end
@@ -108,7 +109,7 @@ Could not fetch specs from #{mirror}/"
gem 'weakling'
G
- bundle :install
+ bundle :install, :artifice => nil
expect(out).to include("Fetching source index from #{mirror}")
expect(out).to include("Retrying fetcher due to error (2/4): Bundler::HTTPError Could not fetch specs from #{mirror}")
diff --git a/spec/bundler/realworld/parallel_spec.rb b/spec/bundler/realworld/parallel_spec.rb
index 6950bead19..ed4430c68b 100644
--- a/spec/bundler/realworld/parallel_spec.rb
+++ b/spec/bundler/realworld/parallel_spec.rb
@@ -1,5 +1,4 @@
# frozen_string_literal: true
-require "spec_helper"
RSpec.describe "parallel", :realworld => true, :sometimes => true do
it "installs" do
@@ -18,14 +17,11 @@ RSpec.describe "parallel", :realworld => true, :sometimes => true do
expect(out).to include("is not threadsafe")
end
- bundle "show activesupport"
+ bundle "info activesupport --path"
expect(out).to match(/activesupport/)
- bundle "show faker"
+ bundle "info faker --path"
expect(out).to match(/faker/)
-
- bundle "config jobs"
- expect(out).to match(/: "4"/)
end
it "updates" do
@@ -42,7 +38,7 @@ RSpec.describe "parallel", :realworld => true, :sometimes => true do
gem 'i18n', '~> 0.6.0' # Because 0.7+ requires Ruby 1.9.3+
G
- bundle :update, :jobs => 4, :env => { "DEBUG" => "1" }
+ bundle :update, :jobs => 4, :env => { "DEBUG" => "1" }, :all => bundle_update_requires_all?
if Bundler.rubygems.provides?(">= 2.1.0")
expect(out).to match(/[1-3]: /)
@@ -50,14 +46,11 @@ RSpec.describe "parallel", :realworld => true, :sometimes => true do
expect(out).to include("is not threadsafe")
end
- bundle "show activesupport"
+ bundle "info activesupport --path"
expect(out).to match(/activesupport-3\.2\.\d+/)
- bundle "show faker"
+ bundle "info faker --path"
expect(out).to match(/faker/)
-
- bundle "config jobs"
- expect(out).to match(/: "4"/)
end
it "works with --standalone" do