From 70b4503b5acc2021f49651bc1754a5c4931c7e7b Mon Sep 17 00:00:00 2001 From: GCorbel Date: Mon, 4 Mar 2024 13:10:09 -0500 Subject: [PATCH] fix --- lib/rspec/mocks/exclude_stubbed_classes_from_subclasses.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rspec/mocks/exclude_stubbed_classes_from_subclasses.rb b/lib/rspec/mocks/exclude_stubbed_classes_from_subclasses.rb index eeeb305f6..770676dc2 100644 --- a/lib/rspec/mocks/exclude_stubbed_classes_from_subclasses.rb +++ b/lib/rspec/mocks/exclude_stubbed_classes_from_subclasses.rb @@ -5,7 +5,7 @@ module Mocks # @private class ExcludeStubbedClassesFromSubclasses def self.enable! - return if Class.method_defined?(:subclasses) # RUBY_VERSION >= "3.1" + return unless RUBY_VERSION >= "3.1" return if Class.respond_to?(:subclasses_with_rspec_mocks) require 'weakref'