Name : perl-Test-Magpie
| |
Version : 0.11
| Vendor : obs://build_opensuse_org/devel:kanku
|
Release : lp155.7.5
| Date : 2023-05-18 00:04:57
|
Group : Development/Libraries/Perl
| Source RPM : perl-Test-Magpie-0.11-lp155.7.5.src.rpm
|
Size : 0.08 MB
| |
Packager : https://www_suse_com/
| |
Summary : Mocking framework with method stubs and behaviour verification
|
Description :
Test::Magpie is a test double framework heavily inspired by the Mockito framework for Java, and also the Python-Mockito project. In Mockito, you \"spy\" on objects for their behaviour, rather than being upfront about what should happen. I find this approach to be significantly more flexible and easier to work with than mocking systems like EasyMock, so I created a Perl implementation.
* Mock objects
Mock objects, represented by the Test::Magpie::Mock manpage objects, are objects that pretend to be everything you could ever want them to be. A mock object can have any method called on it, does every roles, and isa subclass of any superclass. This allows you to easily throw a mock object around it will be treated as though it was a real object.
* Method stubbing
Any method can be called on a mock object, and it will be logged as an invocation. By default, method calls return \'undef\' in scalar context or an empty list in list context. Often, though, clients will be interested in the result of calling a method with some arguments. So you may specify how a method stub should respond when it is called.
* Verify interactions
After calling your concrete code (the code under test) you may want to check that the code did operate correctly on the mock. To do this, you can use verifications to make sure code was called, with correct parameters and the correct amount of times.
* Argument matching
Magpie gives you some helpful methods to validate arguments passed in to calls. You can check equality between arguments, or consume a general type of argument, or consume multiple arguments. See the Test::Magpie::ArgumentMatcher manpage for the juicy details.
|
RPM found in directory: /packages/linux-pbone/ftp5.gwdg.de/pub/opensuse/repositories/devel:/kanku:/perl/15.5/noarch |