Skip to content

Commit a0ff19a

Browse files
authored
Merge pull request #1458 from mbj/fix/zombifier-on-memoized
Fix zombifier on memoized methods
2 parents 7ee17ba + 2988ea6 commit a0ff19a

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

Changelog.md

+10-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,22 @@
1+
# v0.12.5 unreleased
2+
3+
* [#1458](https://github.com/mbj/mutant/pull/1458)
4+
5+
Fix zombifier on memoized methods (only relevant for mutant developers).
6+
17
# v0.12.4 2024-06-30
28

3-
* [#1455](https://github.com/mbj/mutant/pull/1454)
9+
* [#1455](https://github.com/mbj/mutant/pull/1455)
410

511
Fix parsing of empty rspec descriptions
612

713
# v0.12.3 2024-06-10
814

9-
* [#1452](https://github.com/mbj/mutant/pull/1451)
15+
* [#1453](https://github.com/mbj/mutant/pull/1453)
1016

1117
Remove support for EOL Ruby-3.0.
18+
19+
* [#1450](https://github.com/mbj/mutant/pull/1450)
1220
Remove another invalid mutation to super().
1321

1422
# v0.12.2 2024-06-09

lib/mutant/matcher/method/instance.rb

+5-1
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,12 @@ def self.new(scope:, target_method:)
3030
end
3131
# rubocop:enable Metrics/MethodLength
3232

33+
TARGET_MEMOIZER = ::Mutant::Adamantium
34+
35+
private_constant(*constants(false))
36+
3337
def self.memoized_method?(scope, method_name)
34-
scope.raw < Adamantium && scope.raw.memoized?(method_name)
38+
scope.raw < TARGET_MEMOIZER && scope.raw.memoized?(method_name)
3539
end
3640
private_class_method :memoized_method?
3741

0 commit comments

Comments
 (0)