Skip to content

Commit

Permalink
Share GemNetHTTPAdapter between tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jurre committed Apr 26, 2024
1 parent 9573055 commit 34fa5bb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# typed: false
# frozen_string_literal: true

require "rubygems/vendored_net_http"

Expand Down
4 changes: 1 addition & 3 deletions bundler/helpers/v1/spec/native_spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

$LOAD_PATH.unshift(File.expand_path("../lib", __dir__))
$LOAD_PATH.unshift(File.expand_path("../monkey_patches", __dir__))
$LOAD_PATH.unshift(File.expand_path("./helpers", __dir__))
$LOAD_PATH.unshift(File.expand_path("../../spec_helpers", __dir__))

# Bundler monkey patches
require "definition_ruby_version_patch"
Expand All @@ -27,8 +27,6 @@
config.raise_errors_for_deprecations!
end

WebMock.disable_net_connect!(allow_localhost: true)

# Duplicated in lib/dependabot/bundler/file_updater/lockfile_updater.rb
# TODO: Stop sanitizing the lockfile once we have bundler 2 installed
LOCKFILE_ENDING = /(?<ending>\s*(?:RUBY VERSION|BUNDLED WITH).*)/m
Expand Down
3 changes: 3 additions & 0 deletions bundler/helpers/v2/spec/native_spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

$LOAD_PATH.unshift(File.expand_path("../lib", __dir__))
$LOAD_PATH.unshift(File.expand_path("../monkey_patches", __dir__))
$LOAD_PATH.unshift(File.expand_path("../../spec_helpers", __dir__))

# Bundler monkey patches
require "definition_ruby_version_patch"
Expand All @@ -15,6 +16,8 @@

require "functions"

require "gem_net_http_adapter"

RSpec.configure do |config|
config.color = true
config.order = :rand
Expand Down

0 comments on commit 34fa5bb

Please sign in to comment.