summaryrefslogtreecommitdiff
path: root/spec/bundler/support/artifice/fail.rb
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2022-12-15 18:00:04 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2022-12-15 19:06:40 +0900
commit49b0f3b024855efad66a386595eabd103058826d (patch)
tree629182a46cb9e8b4bc9661878e07e1e9a539ac32 /spec/bundler/support/artifice/fail.rb
parent2581de112c1957dc4b5852e54337551dc8972c99 (diff)
Merge RubyGems/Bundler master
Pick from https://github.com/rubygems/rubygems/commit/084f7d1f21f6fc3e2bb685b7bda3653fb2891c6e
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/6936
Diffstat (limited to 'spec/bundler/support/artifice/fail.rb')
-rw-r--r--spec/bundler/support/artifice/fail.rb11
1 files changed, 3 insertions, 8 deletions
diff --git a/spec/bundler/support/artifice/fail.rb b/spec/bundler/support/artifice/fail.rb
index f69f2eccc6..6286e43fbd 100644
--- a/spec/bundler/support/artifice/fail.rb
+++ b/spec/bundler/support/artifice/fail.rb
@@ -2,10 +2,6 @@
require "net/http"
-# We can't use artifice here because it uses rack
-
-module Artifice; end # for < 2.0, Net::HTTP::Persistent::SSLReuse
-
class Fail < Net::HTTP
# Net::HTTP uses a @newimpl instance variable to decide whether
# to use a legacy implementation. Since we are subclassing
@@ -27,8 +23,7 @@ class Fail < Net::HTTP
end
end
+require_relative "helpers/artifice"
+
# Replace Net::HTTP with our failing subclass
-::Net.class_eval do
- remove_const(:HTTP)
- const_set(:HTTP, ::Fail)
-end
+Artifice.replace_net_http(::Fail)