diff --git a/Changelog.md b/Changelog.md index adccfc356..70ca60570 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,12 +1,17 @@ +# v0.12.6 unreleased + +* [#1458](https://github.com/mbj/mutant/pull/1458) + Fix zombified mutant on memoized methods (only relevant for mutant developers). + # v0.12.4 2024-06-30 -* [#1455](https://github.com/mbj/mutant/pull/1454) +* [#1455](https://github.com/mbj/mutant/pull/1455) Fix parsing of empty rspec descriptions # v0.12.3 2024-06-10 -* [#1452](https://github.com/mbj/mutant/pull/1451) +* [#1452](https://github.com/mbj/mutant/pull/1452) Remove support for EOL Ruby-3.0. Remove another invalid mutation to super(). diff --git a/lib/mutant/matcher/method/instance.rb b/lib/mutant/matcher/method/instance.rb index 7df4b71de..00119d8ce 100644 --- a/lib/mutant/matcher/method/instance.rb +++ b/lib/mutant/matcher/method/instance.rb @@ -30,8 +30,13 @@ def self.new(scope:, target_method:) end # rubocop:enable Metrics/MethodLength + TARGET_MEMOIZER = ::Mutant::Adamantium + + private_constant(*constants(false)) + + # mutant:disable - very hard for zombie def self.memoized_method?(scope, method_name) - scope.raw < Adamantium && scope.raw.memoized?(method_name) + scope.raw < TARGET_MEMOIZER && scope.raw.memoized?(method_name) end private_class_method :memoized_method?