How to Install and Uninstall perl-Test-Magpie Package on openSuSE Tumbleweed

Last updated: May 17,2024

1. Install "perl-Test-Magpie" package

Please follow the steps below to install perl-Test-Magpie on openSuSE Tumbleweed

$ sudo zypper refresh $ sudo zypper install perl-Test-Magpie

2. Uninstall "perl-Test-Magpie" package

This tutorial shows how to uninstall perl-Test-Magpie on openSuSE Tumbleweed:

$ sudo zypper remove perl-Test-Magpie

3. Information about the perl-Test-Magpie package on openSuSE Tumbleweed

Information for package perl-Test-Magpie:
-----------------------------------------
Repository : openSUSE-Tumbleweed-Oss
Name : perl-Test-Magpie
Version : 0.11-1.16
Arch : noarch
Vendor : openSUSE
Installed Size : 76.6 KiB
Installed : No
Status : not installed
Source package : perl-Test-Magpie-0.11-1.16.src
Upstream URL : https://metacpan.org/release/Test-Magpie
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 Test::Magpie::Mock 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
Test::Magpie::ArgumentMatcher for the juicy details.