diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-10-30 18:38:29 +0100 |
---|---|---|
committer | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-11-04 17:49:26 +0100 |
commit | 43c7f2ee13225cc8eb8431afbcbd87c8d1856bf8 (patch) | |
tree | f76e3e4046da12b2e84a8e5c4ad2b9bcb2b173ea | |
parent | 3a4b5d6b25ffc7699ac7f6c430a9c2f719bc429c (diff) | |
download | bundler-43c7f2ee13225cc8eb8431afbcbd87c8d1856bf8.tar.gz |
Simplify a bunch of test requires
43 files changed, 43 insertions, 43 deletions
diff --git a/spec/realworld/dependency_api_spec.rb b/spec/realworld/dependency_api_spec.rb index c04003073e..dea8329a4d 100644 --- a/spec/realworld/dependency_api_spec.rb +++ b/spec/realworld/dependency_api_spec.rb @@ -10,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/realworld/gemfile_source_header_spec.rb b/spec/realworld/gemfile_source_header_spec.rb index 8658c836c3..3f507b056a 100644 --- a/spec/realworld/gemfile_source_header_spec.rb +++ b/spec/realworld/gemfile_source_header_spec.rb @@ -37,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/realworld/mirror_probe_spec.rb b/spec/realworld/mirror_probe_spec.rb index a0db3cd9ec..735fb2b3dd 100644 --- a/spec/realworld/mirror_probe_spec.rb +++ b/spec/realworld/mirror_probe_spec.rb @@ -123,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, diff --git a/spec/runtime/inline_spec.rb b/spec/runtime/inline_spec.rb index 301e2e9c0b..e5569fec94 100644 --- a/spec/runtime/inline_spec.rb +++ b/spec/runtime/inline_spec.rb @@ -3,7 +3,7 @@ RSpec.describe "bundler/inline#gemfile" do def script(code, options = {}) requires = ["#{lib_dir}/bundler/inline"] - requires.unshift File.expand_path("../../support/artifice/" + options.delete(:artifice) + ".rb", __FILE__) if options.key?(:artifice) + requires.unshift "#{spec_dir}/support/artifice/" + options.delete(:artifice) if options.key?(:artifice) requires = requires.map {|r| "require '#{r}'" }.join("\n") @out = ruby("#{requires}\n\n" + code, options) end diff --git a/spec/support/artifice/compact_index.rb b/spec/support/artifice/compact_index.rb index 4f01690ae4..89362c4dbc 100644 --- a/spec/support/artifice/compact_index.rb +++ b/spec/support/artifice/compact_index.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require File.expand_path("../endpoint", __FILE__) +require_relative "endpoint" $LOAD_PATH.unshift Dir[base_system_gems.join("gems/compact_index*/lib")].first.to_s require "compact_index" diff --git a/spec/support/artifice/compact_index_api_missing.rb b/spec/support/artifice/compact_index_api_missing.rb index 94e6b73000..fdd342bc08 100644 --- a/spec/support/artifice/compact_index_api_missing.rb +++ b/spec/support/artifice/compact_index_api_missing.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require File.expand_path("../compact_index", __FILE__) +require_relative "compact_index" Artifice.deactivate diff --git a/spec/support/artifice/compact_index_basic_authentication.rb b/spec/support/artifice/compact_index_basic_authentication.rb index 97aa6cbd84..775f1a3977 100644 --- a/spec/support/artifice/compact_index_basic_authentication.rb +++ b/spec/support/artifice/compact_index_basic_authentication.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require File.expand_path("../compact_index", __FILE__) +require_relative "compact_index" Artifice.deactivate diff --git a/spec/support/artifice/compact_index_checksum_mismatch.rb b/spec/support/artifice/compact_index_checksum_mismatch.rb index 62feb9f164..1abe64236c 100644 --- a/spec/support/artifice/compact_index_checksum_mismatch.rb +++ b/spec/support/artifice/compact_index_checksum_mismatch.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require File.expand_path("../compact_index", __FILE__) +require_relative "compact_index" Artifice.deactivate diff --git a/spec/support/artifice/compact_index_concurrent_download.rb b/spec/support/artifice/compact_index_concurrent_download.rb index 972ecb88b7..7f989a3f37 100644 --- a/spec/support/artifice/compact_index_concurrent_download.rb +++ b/spec/support/artifice/compact_index_concurrent_download.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require File.expand_path("../compact_index", __FILE__) +require_relative "compact_index" Artifice.deactivate diff --git a/spec/support/artifice/compact_index_creds_diff_host.rb b/spec/support/artifice/compact_index_creds_diff_host.rb index 0d349bcc1e..6c3442e14b 100644 --- a/spec/support/artifice/compact_index_creds_diff_host.rb +++ b/spec/support/artifice/compact_index_creds_diff_host.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require File.expand_path("../compact_index", __FILE__) +require_relative "compact_index" Artifice.deactivate diff --git a/spec/support/artifice/compact_index_extra.rb b/spec/support/artifice/compact_index_extra.rb index 84d1859235..3a09afd06f 100644 --- a/spec/support/artifice/compact_index_extra.rb +++ b/spec/support/artifice/compact_index_extra.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require File.expand_path("../compact_index", __FILE__) +require_relative "compact_index" Artifice.deactivate diff --git a/spec/support/artifice/compact_index_extra_api.rb b/spec/support/artifice/compact_index_extra_api.rb index 903aa900fb..3c716763c0 100644 --- a/spec/support/artifice/compact_index_extra_api.rb +++ b/spec/support/artifice/compact_index_extra_api.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require File.expand_path("../compact_index", __FILE__) +require_relative "compact_index" Artifice.deactivate diff --git a/spec/support/artifice/compact_index_extra_api_missing.rb b/spec/support/artifice/compact_index_extra_api_missing.rb index e72040f604..6bd24ddbb4 100644 --- a/spec/support/artifice/compact_index_extra_api_missing.rb +++ b/spec/support/artifice/compact_index_extra_api_missing.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require File.expand_path("../compact_index_extra_api", __FILE__) +require_relative "compact_index_extra_api" Artifice.deactivate diff --git a/spec/support/artifice/compact_index_extra_missing.rb b/spec/support/artifice/compact_index_extra_missing.rb index 67a9d23691..4758b785ac 100644 --- a/spec/support/artifice/compact_index_extra_missing.rb +++ b/spec/support/artifice/compact_index_extra_missing.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require File.expand_path("../compact_index_extra", __FILE__) +require_relative "compact_index_extra" Artifice.deactivate diff --git a/spec/support/artifice/compact_index_forbidden.rb b/spec/support/artifice/compact_index_forbidden.rb index 0a4dfdb2e8..3eebe0fbd8 100644 --- a/spec/support/artifice/compact_index_forbidden.rb +++ b/spec/support/artifice/compact_index_forbidden.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require File.expand_path("../compact_index", __FILE__) +require_relative "compact_index" Artifice.deactivate diff --git a/spec/support/artifice/compact_index_host_redirect.rb b/spec/support/artifice/compact_index_host_redirect.rb index ab371117de..304c897d68 100644 --- a/spec/support/artifice/compact_index_host_redirect.rb +++ b/spec/support/artifice/compact_index_host_redirect.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require File.expand_path("../compact_index", __FILE__) +require_relative "compact_index" Artifice.deactivate diff --git a/spec/support/artifice/compact_index_no_gem.rb b/spec/support/artifice/compact_index_no_gem.rb index 01c5be1b3d..0a4be08a46 100644 --- a/spec/support/artifice/compact_index_no_gem.rb +++ b/spec/support/artifice/compact_index_no_gem.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require File.expand_path("../compact_index", __FILE__) +require_relative "compact_index" Artifice.deactivate diff --git a/spec/support/artifice/compact_index_partial_update.rb b/spec/support/artifice/compact_index_partial_update.rb index eaedff5105..6e7c05d423 100644 --- a/spec/support/artifice/compact_index_partial_update.rb +++ b/spec/support/artifice/compact_index_partial_update.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require File.expand_path("../compact_index", __FILE__) +require_relative "compact_index" Artifice.deactivate diff --git a/spec/support/artifice/compact_index_range_not_satisfiable.rb b/spec/support/artifice/compact_index_range_not_satisfiable.rb index 487be4771a..788f9d6f99 100644 --- a/spec/support/artifice/compact_index_range_not_satisfiable.rb +++ b/spec/support/artifice/compact_index_range_not_satisfiable.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require File.expand_path("../compact_index", __FILE__) +require_relative "compact_index" Artifice.deactivate diff --git a/spec/support/artifice/compact_index_rate_limited.rb b/spec/support/artifice/compact_index_rate_limited.rb index d8f4fc941c..ba17476045 100644 --- a/spec/support/artifice/compact_index_rate_limited.rb +++ b/spec/support/artifice/compact_index_rate_limited.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require File.expand_path("../compact_index", __FILE__) +require_relative "compact_index" Artifice.deactivate diff --git a/spec/support/artifice/compact_index_redirects.rb b/spec/support/artifice/compact_index_redirects.rb index e83451b5b6..99adc797bf 100644 --- a/spec/support/artifice/compact_index_redirects.rb +++ b/spec/support/artifice/compact_index_redirects.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require File.expand_path("../compact_index", __FILE__) +require_relative "compact_index" Artifice.deactivate diff --git a/spec/support/artifice/compact_index_strict_basic_authentication.rb b/spec/support/artifice/compact_index_strict_basic_authentication.rb index abbf3258e7..7d427b5382 100644 --- a/spec/support/artifice/compact_index_strict_basic_authentication.rb +++ b/spec/support/artifice/compact_index_strict_basic_authentication.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require File.expand_path("../compact_index", __FILE__) +require_relative "compact_index" Artifice.deactivate diff --git a/spec/support/artifice/compact_index_wrong_dependencies.rb b/spec/support/artifice/compact_index_wrong_dependencies.rb index 7e1d3686e2..036fac70b3 100644 --- a/spec/support/artifice/compact_index_wrong_dependencies.rb +++ b/spec/support/artifice/compact_index_wrong_dependencies.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require File.expand_path("../compact_index", __FILE__) +require_relative "compact_index" Artifice.deactivate diff --git a/spec/support/artifice/compact_index_wrong_gem_checksum.rb b/spec/support/artifice/compact_index_wrong_gem_checksum.rb index db4d8e3974..8add32b88f 100644 --- a/spec/support/artifice/compact_index_wrong_gem_checksum.rb +++ b/spec/support/artifice/compact_index_wrong_gem_checksum.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require File.expand_path("../compact_index", __FILE__) +require_relative "compact_index" Artifice.deactivate diff --git a/spec/support/artifice/endopint_marshal_fail_basic_authentication.rb b/spec/support/artifice/endopint_marshal_fail_basic_authentication.rb index 12a6fa153f..c341c3993f 100644 --- a/spec/support/artifice/endopint_marshal_fail_basic_authentication.rb +++ b/spec/support/artifice/endopint_marshal_fail_basic_authentication.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require File.expand_path("../endpoint_marshal_fail", __FILE__) +require_relative "endpoint_marshal_fail" Artifice.deactivate diff --git a/spec/support/artifice/endpoint.rb b/spec/support/artifice/endpoint.rb index bc2daf3edc..bf26c56503 100644 --- a/spec/support/artifice/endpoint.rb +++ b/spec/support/artifice/endpoint.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require File.expand_path("../../path.rb", __FILE__) +require_relative "../path" require Spec::Path.lib_dir.join("bundler/deprecate") include Spec::Path diff --git a/spec/support/artifice/endpoint_500.rb b/spec/support/artifice/endpoint_500.rb index ad51d58e67..f98e7e3bc2 100644 --- a/spec/support/artifice/endpoint_500.rb +++ b/spec/support/artifice/endpoint_500.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require File.expand_path("../../path.rb", __FILE__) +require_relative "../path" include Spec::Path $LOAD_PATH.unshift(*Dir[Spec::Path.base_system_gems.join("gems/{artifice,mustermann,rack,tilt,sinatra}-*/lib")].map(&:to_s)) diff --git a/spec/support/artifice/endpoint_api_forbidden.rb b/spec/support/artifice/endpoint_api_forbidden.rb index bb89747adc..edc2463424 100644 --- a/spec/support/artifice/endpoint_api_forbidden.rb +++ b/spec/support/artifice/endpoint_api_forbidden.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require File.expand_path("../endpoint", __FILE__) +require_relative "endpoint" Artifice.deactivate diff --git a/spec/support/artifice/endpoint_api_missing.rb b/spec/support/artifice/endpoint_api_missing.rb index 2ada0dc553..8dafde7362 100644 --- a/spec/support/artifice/endpoint_api_missing.rb +++ b/spec/support/artifice/endpoint_api_missing.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require File.expand_path("../endpoint", __FILE__) +require_relative "endpoint" Artifice.deactivate diff --git a/spec/support/artifice/endpoint_basic_authentication.rb b/spec/support/artifice/endpoint_basic_authentication.rb index 223671bc29..ff3d1493d6 100644 --- a/spec/support/artifice/endpoint_basic_authentication.rb +++ b/spec/support/artifice/endpoint_basic_authentication.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require File.expand_path("../endpoint", __FILE__) +require_relative "endpoint" Artifice.deactivate diff --git a/spec/support/artifice/endpoint_creds_diff_host.rb b/spec/support/artifice/endpoint_creds_diff_host.rb index 925954b12d..f20ef74ac6 100644 --- a/spec/support/artifice/endpoint_creds_diff_host.rb +++ b/spec/support/artifice/endpoint_creds_diff_host.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require File.expand_path("../endpoint", __FILE__) +require_relative "endpoint" Artifice.deactivate diff --git a/spec/support/artifice/endpoint_extra.rb b/spec/support/artifice/endpoint_extra.rb index 422f65401b..31f6822161 100644 --- a/spec/support/artifice/endpoint_extra.rb +++ b/spec/support/artifice/endpoint_extra.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require File.expand_path("../endpoint", __FILE__) +require_relative "endpoint" Artifice.deactivate diff --git a/spec/support/artifice/endpoint_extra_api.rb b/spec/support/artifice/endpoint_extra_api.rb index 62e2c2bb93..213b8e5895 100644 --- a/spec/support/artifice/endpoint_extra_api.rb +++ b/spec/support/artifice/endpoint_extra_api.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require File.expand_path("../endpoint", __FILE__) +require_relative "endpoint" Artifice.deactivate diff --git a/spec/support/artifice/endpoint_extra_missing.rb b/spec/support/artifice/endpoint_extra_missing.rb index 038a12610a..ee129025ff 100644 --- a/spec/support/artifice/endpoint_extra_missing.rb +++ b/spec/support/artifice/endpoint_extra_missing.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require File.expand_path("../endpoint_extra", __FILE__) +require_relative "endpoint_extra" Artifice.deactivate diff --git a/spec/support/artifice/endpoint_fallback.rb b/spec/support/artifice/endpoint_fallback.rb index 554c08f0a2..08edf232e3 100644 --- a/spec/support/artifice/endpoint_fallback.rb +++ b/spec/support/artifice/endpoint_fallback.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require File.expand_path("../endpoint", __FILE__) +require_relative "endpoint" Artifice.deactivate diff --git a/spec/support/artifice/endpoint_host_redirect.rb b/spec/support/artifice/endpoint_host_redirect.rb index cda5664be2..338cbcad00 100644 --- a/spec/support/artifice/endpoint_host_redirect.rb +++ b/spec/support/artifice/endpoint_host_redirect.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require File.expand_path("../endpoint", __FILE__) +require_relative "endpoint" Artifice.deactivate diff --git a/spec/support/artifice/endpoint_marshal_fail.rb b/spec/support/artifice/endpoint_marshal_fail.rb index 2a5dcdc2fd..22c13e3e17 100644 --- a/spec/support/artifice/endpoint_marshal_fail.rb +++ b/spec/support/artifice/endpoint_marshal_fail.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require File.expand_path("../endpoint_fallback", __FILE__) +require_relative "endpoint_fallback" Artifice.deactivate diff --git a/spec/support/artifice/endpoint_mirror_source.rb b/spec/support/artifice/endpoint_mirror_source.rb index 64452f198d..318866e420 100644 --- a/spec/support/artifice/endpoint_mirror_source.rb +++ b/spec/support/artifice/endpoint_mirror_source.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require File.expand_path("../endpoint", __FILE__) +require_relative "endpoint" class EndpointMirrorSource < Endpoint get "/gems/:id" do diff --git a/spec/support/artifice/endpoint_redirect.rb b/spec/support/artifice/endpoint_redirect.rb index ebf01458ba..ee97fccf64 100644 --- a/spec/support/artifice/endpoint_redirect.rb +++ b/spec/support/artifice/endpoint_redirect.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require File.expand_path("../endpoint", __FILE__) +require_relative "endpoint" Artifice.deactivate diff --git a/spec/support/artifice/endpoint_strict_basic_authentication.rb b/spec/support/artifice/endpoint_strict_basic_authentication.rb index 905a519f3f..4d4da08770 100644 --- a/spec/support/artifice/endpoint_strict_basic_authentication.rb +++ b/spec/support/artifice/endpoint_strict_basic_authentication.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require File.expand_path("../endpoint", __FILE__) +require_relative "endpoint" Artifice.deactivate diff --git a/spec/support/artifice/endpoint_timeout.rb b/spec/support/artifice/endpoint_timeout.rb index 3f60471c90..c118da1893 100644 --- a/spec/support/artifice/endpoint_timeout.rb +++ b/spec/support/artifice/endpoint_timeout.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require File.expand_path("../endpoint_fallback", __FILE__) +require_relative "endpoint_fallback" Artifice.deactivate diff --git a/spec/support/artifice/windows.rb b/spec/support/artifice/windows.rb index 0630798df0..ce7455b86c 100644 --- a/spec/support/artifice/windows.rb +++ b/spec/support/artifice/windows.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require File.expand_path("../../path.rb", __FILE__) +require_relative "../path" include Spec::Path $LOAD_PATH.unshift(*Dir[Spec::Path.base_system_gems.join("gems/{artifice,mustermann,rack,tilt,sinatra}-*/lib")].map(&:to_s)) diff --git a/spec/support/helpers.rb b/spec/support/helpers.rb index de5ecf1ddc..1099602fc1 100644 --- a/spec/support/helpers.rb +++ b/spec/support/helpers.rb @@ -121,7 +121,7 @@ module Spec end end if artifice - requires << File.expand_path("../artifice/#{artifice}", __FILE__) + requires << "support/artifice/#{artifice}" end requires_str = requires.map {|r| "-r#{r}" }.join(" ") |