summaryrefslogtreecommitdiff
path: root/spec/bundler/realworld
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2019-11-11 17:57:45 +0900
committerSHIBATA Hiroshi <hsbt@ruby-lang.org>2019-11-11 18:56:25 +0900
commit7585bc31877d4f9725f8de51b4a2faf47acb6f34 (patch)
treeadf61a7c20f7e54b595ebde05284b5e2862f552c /spec/bundler/realworld
parentfd69f82675bf93a848e5aa58d117bf8bbf604188 (diff)
Merge Bundler 2.1.0.pre.3
Features: - Add caller information to some deprecation messages to make them easier to fix [#7361](https://github.com/bundler/bundler/pull/7361) - Reconcile `bundle cache` vs `bundle package` everywhere. Now in docs, CLI help and everywhere else `bundle cache` is the preferred version and `bundle package` remains as an alias [#7389](https://github.com/bundler/bundler/pull/7389) - Display some basic `bundler` documentation together with ruby's RDoc based documentation [#7394](https://github.com/bundler/bundler/pull/7394) Bugfixes: - Fix typos deprecation message and upgrading docs [#7374](https://github.com/bundler/bundler/pull/7374) - Deprecation warnings about `taint` usage on ruby 2.7 [#7385](https://github.com/bundler/bundler/pull/7385) - Fix `--help` flag not correctly delegating to `man` when used with command aliases [#7388](https://github.com/bundler/bundler/pull/7388) - `bundle add` should cache newly added gems if an application cache exists [#7393](https://github.com/bundler/bundler/pull/7393) - Stop using an insecure folder as a "fallback home" when user home is not defined [#7416](https://github.com/bundler/bundler/pull/7416) - Fix `bundler/inline` warning about `Bundler.root` redefinition [#7417](https://github.com/bundler/bundler/pull/7417)
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/2668
Diffstat (limited to 'spec/bundler/realworld')
-rw-r--r--spec/bundler/realworld/dependency_api_spec.rb4
-rw-r--r--spec/bundler/realworld/double_check_spec.rb6
-rw-r--r--spec/bundler/realworld/edgecases_spec.rb20
-rw-r--r--spec/bundler/realworld/gemfile_source_header_spec.rb4
-rw-r--r--spec/bundler/realworld/mirror_probe_spec.rb4
5 files changed, 23 insertions, 15 deletions
diff --git a/spec/bundler/realworld/dependency_api_spec.rb b/spec/bundler/realworld/dependency_api_spec.rb
index e7d11419cd..dea8329a4d 100644
--- a/spec/bundler/realworld/dependency_api_spec.rb
+++ b/spec/bundler/realworld/dependency_api_spec.rb
@@ -1,5 +1,7 @@
# frozen_string_literal: true
+require_relative "../support/silent_logger"
+
RSpec.describe "gemcutter's dependency API", :realworld => true do
context "when Gemcutter API takes too long to respond" do
before do
@@ -8,7 +10,7 @@ RSpec.describe "gemcutter's dependency API", :realworld => true do
port = find_unused_port
@server_uri = "http://127.0.0.1:#{port}"
- require File.expand_path("../../support/artifice/endpoint_timeout", __FILE__)
+ require_relative "../support/artifice/endpoint_timeout"
@t = Thread.new do
server = Rack::Server.start(:app => EndpointTimeout,
diff --git a/spec/bundler/realworld/double_check_spec.rb b/spec/bundler/realworld/double_check_spec.rb
index 323e0d5735..90cf298b33 100644
--- a/spec/bundler/realworld/double_check_spec.rb
+++ b/spec/bundler/realworld/double_check_spec.rb
@@ -25,9 +25,9 @@ RSpec.describe "double checking sources", :realworld => true, :sometimes => true
RUBY
cmd = <<-RUBY
- require "#{lib}/bundler"
- require #{File.expand_path("../../support/artifice/vcr.rb", __FILE__).dump}
- require "#{lib}/bundler/inline"
+ require "#{lib_dir}/bundler"
+ require "#{spec_dir}/support/artifice/vcr"
+ require "#{lib_dir}/bundler/inline"
gemfile(true) do
source "https://rubygems.org"
gem "rails", path: "."
diff --git a/spec/bundler/realworld/edgecases_spec.rb b/spec/bundler/realworld/edgecases_spec.rb
index 6468ee7f1e..53d9f9a026 100644
--- a/spec/bundler/realworld/edgecases_spec.rb
+++ b/spec/bundler/realworld/edgecases_spec.rb
@@ -3,19 +3,21 @@
RSpec.describe "real world edgecases", :realworld => true, :sometimes => true do
def rubygems_version(name, requirement)
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
+ require "#{spec_dir}/support/artifice/vcr"
+ require "#{lib_dir}/bundler"
+ require "#{lib_dir}/bundler/source/rubygems/remote"
+ require "#{lib_dir}/bundler/fetcher"
+ rubygem = Bundler.ui.silence do
+ source = Bundler::Source::Rubygems::Remote.new(URI("https://rubygems.org"))
+ fetcher = Bundler::Fetcher.new(source)
+ index = fetcher.specs([#{name.dump}], nil)
+ index.search(Gem::Dependency.new(#{name.dump}, #{requirement.dump})).last
+ end
if rubygem.nil?
raise "Could not find #{name} (#{requirement}) on rubygems.org!\n" \
"Found specs:\n\#{index.send(:specs).inspect}"
end
- "#{name} (\#{rubygem.version})"
+ puts "#{name} (\#{rubygem.version})"
RUBY
end
diff --git a/spec/bundler/realworld/gemfile_source_header_spec.rb b/spec/bundler/realworld/gemfile_source_header_spec.rb
index 382485b8fc..3f507b056a 100644
--- a/spec/bundler/realworld/gemfile_source_header_spec.rb
+++ b/spec/bundler/realworld/gemfile_source_header_spec.rb
@@ -1,5 +1,7 @@
# frozen_string_literal: true
+require_relative "../support/silent_logger"
+
RSpec.describe "fetching dependencies with a mirrored source", :realworld => true do
let(:mirror) { "https://server.example.org" }
let(:original) { "http://127.0.0.1:#{@port}" }
@@ -35,7 +37,7 @@ private
@port = find_unused_port
@server_uri = "http://127.0.0.1:#{@port}"
- require File.expand_path("../../support/artifice/endpoint_mirror_source", __FILE__)
+ require_relative "../support/artifice/endpoint_mirror_source"
@t = Thread.new do
Rack::Server.start(:app => EndpointMirrorSource,
diff --git a/spec/bundler/realworld/mirror_probe_spec.rb b/spec/bundler/realworld/mirror_probe_spec.rb
index 13d1afe124..735fb2b3dd 100644
--- a/spec/bundler/realworld/mirror_probe_spec.rb
+++ b/spec/bundler/realworld/mirror_probe_spec.rb
@@ -1,5 +1,7 @@
# frozen_string_literal: true
+require_relative "../support/silent_logger"
+
RSpec.describe "fetching dependencies with a not available mirror", :realworld => true do
let(:mirror) { @mirror_uri }
let(:original) { @server_uri }
@@ -121,7 +123,7 @@ Could not fetch specs from #{mirror}/
@server_port = find_unused_port
@server_uri = "http://#{host}:#{@server_port}"
- require File.expand_path("../../support/artifice/endpoint", __FILE__)
+ require_relative "../support/artifice/endpoint"
@server_thread = Thread.new do
Rack::Server.start(:app => Endpoint,