BSD Ports

devel/p5-Test-MockDateTime 0.02 FreeBSD

Mock DateTime->now calls during tests

System
FreeBSD
Repository
FreeBSD ports
Maintainer
[email protected]
License
ART10, GPLv1+
Categories
devel, perl5
Package size
7.7 KiB, 11.9 KiB installed

Description

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.

In the other systems

SystemPortVersion
FreeBSDdevel/p5-Test-MockDateTime0.02
DragonFlydevel/p5-Test-MockDateTime0.02
HardenedBSDdevel/p5-Test-MockDateTime0.02
GhostBSDdevel/p5-Test-MockDateTime0.02

Install

Binary package:

pkg install p5-Test-MockDateTime

From the ports tree:

cd /usr/ports/devel/p5-Test-MockDateTime/ && make install clean

To depend on this port in another port's Makefile:

RUN_DEPENDS=	p5-Test-MockDateTime>0:devel/p5-Test-MockDateTime

Packages

The version each package repository carries. “-” means the repository builds no package of it, “n/a” that there is no such repository.

Repositoryaarch64amd64armv6armv7i386
FreeBSD:14:latest0.020.020.020.020.02
FreeBSD:14:quarterly0.020.02n/a0.020.02
FreeBSD:15:latest0.020.02n/a0.020.02
FreeBSD:15:quarterly0.020.02n/an/an/a
FreeBSD:16:latest0.020.02n/an/an/a
FreeBSD:16:quarterlyn/an/an/an/an/a

Dependencies

As this port's Makefile names them.

Build 1

Runtime 1

The full lists below include those, and their dependencies in turn.

Build dependencies 41
Run dependencies 41

No port depends on this one.

Configuration

No options to configure.

USES
perl5
Service scripts
none

Files

pkg-plist 2
  • %%SITE_PERL%%/Test/MockDateTime.pm
  • %%PERL5_MAN3%%/Test::MockDateTime.3.gz
distinfo 1
FileSizeSHA256
Test-MockDateTime-0.02.tar.gz9837c6370a58b9f291fc205121caf92a89865451d49559b0163a8dc7e606f34878dc
Master sites 1
  • CPAN

Commit history 0

No commits in the history this site was built from.