Test::M...:Inspect(3)

πŸ“¦ version 0.11, in opensuse-leap 16.0

✨ 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>

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