Test::M...:Inspect(3)
β¨ NAME β¨
Okay bestie, this page is all about Test::Magpie::Inspect β and yes, itβs a User Contributed Perl Documentation situation π
β and its whole job is to inspect method invocations on mock objects. Periodt.
πΈ SYNOPSIS πΈ
my $mock = mock;
$mock->something({ deep => { structure => [] }};
my $invocation = inspect($mock)->something(anything);
ok(defined $invocation, 'something was called');
is_deeply(($invocation->arguments)[0],
{ deep => { structure => [] }})
π¦ DESCRIPTION π¦
Inspecting a mock object lets you write tests that are slightly clearer than having a complex verification call. No cap, thatβs the whole mood. π«Ά
So inspect in Test::Magpie gives back an object of this class that has the same API as your mock object. When a method is called, it checks if any invocation matches its name and argument specification (inspectors can use argument matchers). If so, it will return that invocation as a Test::Magpie::Invocation object. Otherwise, undef is returned. Thatβs the vibe check, and itβs literally that simple. β¨
π AUTHORS π
- Oliver Charles β
<oliver.g.charles@googlemail.com> - Steven Lee β
<stevenwh.lee@gmail.com>
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2013 by Oliver Charles.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
This page is serving perl v5.42.0 energy, dated 2020-11-24 β mwah ππβ¨
π¦ where this page comes from
- opensuse-leap 16.0: perl-Test-Magpie 0.11-bp160.1.10 Β· Artistic-1.0 OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms