cpan Test-MockModule v0.181.0
0.181.0

latest releases: v0.185.3, v0.185.2, v0.185.1...
one month ago

What's Changed

  • Provide a global way to assure nostrict ever happens by @toddr in #66
  • Fix define() + unmock() bug, CI modernization, prototype tests by @Koan-Bot in #69
  • feat: mocked_subs() introspection + original() fix (GH #52, #42) by @Koan-Bot in #70
  • fix: align noop() return value with mock_all(noop=>1) by @Koan-Bot in #71
  • fix: add strict mode guard to mock_all() by @Koan-Bot in #72
  • ci: add Perl 5.40 and 5.42 to test matrix by @Koan-Bot in #75
  • docs: fix POD typos and syntax errors by @Koan-Bot in #76
  • perf: optimize _strict_mode() with exists check by @Koan-Bot in #73
  • fix: skip special Perl subs in mock_all() by @Koan-Bot in #74

Moose & Mouse meta-class aware mocking (#55)

Test::MockModule now registers mocks on the target's Moose/Mouse meta-class via add_method (in addition to the symbol table) when the target uses Class::MOP::Class or Mouse::Meta::Class. This fixes:

  • Role requires checks failing after mocking (incl. dynamic apply_all_roles).
  • The method 'foo' was not found in the inheritance hierarchy errors when loading a subclass with around foo after mocking the parent's foo.

unmock restores via add_method, or remove_method (Moose) / internal cache purge (Mouse) for inherited originals.

Immutable classes fall back to symbol-table-only with a one-time warning. Moo is not supported (no MOP).

No public API change. Moose/Mouse/Class::MOP are not auto-loaded for non-Moose users.

Full Changelog: 0.181.0...0.182.0

New Contributors

Full Changelog: 0.180.0...0.181.0

Don't miss a new Test-MockModule release

NewReleases is sending notifications on new releases.