Index | index by Group | index by Distribution | index by Vendor | index by creation date | index by Name | Mirrors | Help | Search |
Name: perl-Test-HTTP-MockServer | Distribution: openSUSE Tumbleweed |
Version: 0.0.1 | Vendor: openSUSE |
Release: 2.11 | Build date: Fri Apr 16 17:36:33 2021 |
Group: Unspecified | Build host: reproducible |
Size: 24082 | Source RPM: perl-Test-HTTP-MockServer-0.0.1-2.11.src.rpm |
Packager: http://bugs.opensuse.org | |
Url: https://metacpan.org/release/Test-HTTP-MockServer | |
Summary: Implement a mock HTTP server for use in tests |
Sometimes, when writing a test, you don't have to oportunity to do dependency injection of the type of transport used in a specific API. Sometimes that code willl unequivocally always use actual HTTP and the only control you have is over the host and port to which it will connect. This class offer a simple way to mock the service being called. It does that by binding to a random port on localhost and allowing you to inspect which port that was. Using a random port means that this can be used by tests running in parallel on the same host. The socket will be bound and listened on the main test process, such that the lifetime of the connection is defined by the lifetime of the test itself. Since the socket will be already bound and listened to, the two conntrol methods (start_mock_server and stop_mock_server) fork only for the accept call, which means that it is safe to call start and stop several times during the test in order to change the expectations of the mocked code. That allows you to easily configure the expectations of the mock server across each step of your test case. On the other hand, it also means that no state is shared between the code running in the mock server and the test code.
Apache-2.0
* Fri Apr 16 2021 Frank Schreiner <FSchreiner@suse.com> - added "Requires" for netcfg as "/etc/protocols" is needed * Thu Jan 14 2021 Frank Schreiner <FSchreiner@suse.com> - initial package 0.0.1 * created by cpanspec 1.80.01
/usr/lib/perl5/vendor_perl/5.40.0/Test /usr/lib/perl5/vendor_perl/5.40.0/Test/HTTP /usr/lib/perl5/vendor_perl/5.40.0/Test/HTTP/MockServer /usr/lib/perl5/vendor_perl/5.40.0/Test/HTTP/MockServer.pm /usr/lib/perl5/vendor_perl/5.40.0/Test/HTTP/MockServer/REST.pm /usr/share/doc/packages/perl-Test-HTTP-MockServer /usr/share/doc/packages/perl-Test-HTTP-MockServer/README /usr/share/man/man3/Test::HTTP::MockServer.3pm.gz /usr/share/man/man3/Test::HTTP::MockServer::REST.3pm.gz
Generated by rpm2html 1.8.1
Fabrice Bellet, Sun Feb 9 01:37:00 2025