summaryrefslogtreecommitdiff
path: root/spec/support/unhax.rb
blob: e856a05b0dee5de99e1b15fc86f4c0ddb6cf79d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# frozen_string_literal: true
Artifice.deactivate if defined?(Artifice)
Gem::Request::ConnectionPools.client = ::Net::HTTP if defined?(Gem::Request::ConnectionPools)
class Gem::RemoteFetcher
  @fetcher = nil
end

class Gem::Platform
  @local = nil
end
Gem.platforms.clear

$bundler_spec_stubbed_constants ||= {} # rubocop:disable Style/GlobalVars
$bundler_spec_stubbed_constants.each do |(mod, const), val| # rubocop:disable Style/GlobalVars
  mod.send(:remove_const, const) if mod.send(:const_defined?, const)
  mod.send(:const_set, const, val) if val
end
$bundler_spec_stubbed_constants.clear # rubocop:disable Style/GlobalVars

ENV.delete("BUNDLER_SPEC_ARTIFICE_ENDPOINT")