Skip to content

Commit

Permalink
Merge pull request #1458 from mbj/fix/zombifier-on-memoized
Browse files Browse the repository at this point in the history
Fix zombifier on memoized methods
  • Loading branch information
mbj authored Oct 15, 2024
2 parents 7ee17ba + 2988ea6 commit a0ff19a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
12 changes: 10 additions & 2 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
# v0.12.5 unreleased

* [#1458](https://github.com/mbj/mutant/pull/1458)

Fix zombifier 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)
* [#1453](https://github.com/mbj/mutant/pull/1453)

Remove support for EOL Ruby-3.0.

* [#1450](https://github.com/mbj/mutant/pull/1450)
Remove another invalid mutation to super().

# v0.12.2 2024-06-09
Expand Down
6 changes: 5 additions & 1 deletion lib/mutant/matcher/method/instance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,12 @@ def self.new(scope:, target_method:)
end
# rubocop:enable Metrics/MethodLength

TARGET_MEMOIZER = ::Mutant::Adamantium

private_constant(*constants(false))

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?

Expand Down

0 comments on commit a0ff19a

Please sign in to comment.