p5-Test-MockDateTime - Mock DateTime->now calls during tests

Property Value
Distribution FreeBSD 12
Repository FreeBSD Ports Latest amd64
Package filename p5-Test-MockDateTime-0.02.txz
Package name p5-Test-MockDateTime
Package version 0.02
Package release -
Package architecture amd64
Package type txz
Category devel perl5
Homepage https://metacpan.org/release/Test-MockDateTime
License GPLv1+, ART10
Maintainer perl@FreeBSD.org
Download size 7.13 KB
Installed size 12.09 KB
Getting the current time sometimes is not very helpful
for testing scenarios.
Instead, if you could obtain a known value during the runtime
of a testcase will make your results predictable.
Why another Date Mocker?
I wanted something simple with a very concise usage pattern
and a mocked date should only exist and stay constant inside a scope.
After leaving the scope the current time should be back.
This lead to this tiny module.
This simple module allows faking a given date and time
for the runtime of a subsequent code block.
By default the on keyword is exported into the namespace
of the test file.
The date to get mocked must be in a format that is recognized
by DateTime::Format::DateParse.
WWW: https://metacpan.org/release/Test-MockDateTime


Package Version Architecture Repository
p5-Test-MockDateTime-0.02.txz 0.02 i386 FreeBSD Ports Latest
p5-Test-MockDateTime-0.02.txz 0.02 amd64 FreeBSD Ports Quarterly
p5-Test-MockDateTime-0.02.txz 0.02 i386 FreeBSD Ports Quarterly
p5-Test-MockDateTime - - -


Name Value
p5-DateTime-Format-DateParse = 0.05_2
perl5 = 5.28.1_1


Type URL
Mirror pkg.freebsd.org
Binary Package p5-Test-MockDateTime-0.02.txz
Source Package devel/p5-Test-MockDateTime

Install Howto

Install p5-Test-MockDateTime txz package:

# pkg install p5-Test-MockDateTime

See Also

Package Description
p5-Test-MockModule-0.16.txz Override subroutines in a module for unit testing
p5-Test-MockObject-1.20150527_1.txz Tests remote URLs or local web files
p5-Test-MockRandom-1.01_1.txz Replaces random number generation with non-random number generation
p5-Test-MockTime-0.17.txz Replaces actual time with simulated time
p5-Test-Modern-0.013.txz Precision testing for modern perl
p5-Test-Module-Used-0.2.3_3.txz Test required module is really used and vice versa
p5-Test-Moose-More-0.050.txz More tools for testing Moose packages
p5-Test-More-UTF8-0.04_1.txz Enhancing Test::More for UTF-8-based projects
p5-Test-Most-0.35.txz Perl extension for most commonly needed test functions and features
p5-Test-Name-FromLine-0.13_1.txz Perl extension to fill test names from caller line
p5-Test-Needs-0.002006.txz Skip tests when modules not available
p5-Test-Net-LDAP-0.07.txz Perl extension of Net::LDAP subclass for testing
p5-Test-Net-RabbitMQ-0.13.txz Perl mock RabbitMQ implementation for use when testing
p5-Test-Nginx-0.26.txz Testing modules for Nginx C module development
p5-Test-NoTabs-1.4.txz Check the presence of tabs in your project