diff --git a/activesupport/test/array_inquirer_test.rb b/activesupport/test/array_inquirer_test.rb
index <HASH>..<HASH> 100644
--- a/activesupport/test/array_inquirer_test.rb
+++ b/activesupport/test/array_inquirer_test.rb
@@ -51,6 +51,11 @@ class ArrayInquirerTest < ActiveSupport::TestCase
     assert_respond_to arr, :foo
     assert_not_respond_to arr, :nope
   ensure
-    Array.send :undef_method, :respond_to_missing?
+    Array.class_eval do
+      undef_method :respond_to_missing?
+      def respond_to_missing?(name, include_private = false)
+        super
+      end
+    end
   end
 end
diff --git a/activesupport/test/string_inquirer_test.rb b/activesupport/test/string_inquirer_test.rb
index <HASH>..<HASH> 100644
--- a/activesupport/test/string_inquirer_test.rb
+++ b/activesupport/test/string_inquirer_test.rb
@@ -34,6 +34,11 @@ class StringInquirerTest < ActiveSupport::TestCase
     assert_not_respond_to str, :nope
 
   ensure
-    String.send :undef_method, :respond_to_missing?
+    String.class_eval do
+      undef_method :respond_to_missing?
+      def respond_to_missing?(name, include_private = false)
+        (name == :bar) || super
+      end
+    end
   end
 end
It would be safer not to totally undef core classes' respond_to_missing?

instead, rewrite them to no-op