Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 Nov 2016 06:24:05 +0000 (UTC)
From:      Kurt Jaeger <pi@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r426085 - in head/devel: . p5-Test-MockDateTime
Message-ID:  <201611140624.uAE6O5cv025784@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pi
Date: Mon Nov 14 06:24:05 2016
New Revision: 426085
URL: https://svnweb.freebsd.org/changeset/ports/426085

Log:
  New port: devel/p5-Test-MockDateTime
  
  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: http://search.cpan.org/dist/Test-MockDateTime/
  
  PR:		214397
  Submitted by:	Henk van Oers <hvo.pm@xs4all.nl>

Added:
  head/devel/p5-Test-MockDateTime/
  head/devel/p5-Test-MockDateTime/Makefile   (contents, props changed)
  head/devel/p5-Test-MockDateTime/distinfo   (contents, props changed)
  head/devel/p5-Test-MockDateTime/pkg-descr   (contents, props changed)
  head/devel/p5-Test-MockDateTime/pkg-plist   (contents, props changed)
Modified:
  head/devel/Makefile

Modified: head/devel/Makefile
==============================================================================
--- head/devel/Makefile	Mon Nov 14 06:19:30 2016	(r426084)
+++ head/devel/Makefile	Mon Nov 14 06:24:05 2016	(r426085)
@@ -3320,6 +3320,7 @@
     SUBDIR += p5-Test-Mock-Guard
     SUBDIR += p5-Test-Mock-LWP
     SUBDIR += p5-Test-Mock-LWP-Dispatch
+    SUBDIR += p5-Test-MockDateTime
     SUBDIR += p5-Test-MockModule
     SUBDIR += p5-Test-MockObject
     SUBDIR += p5-Test-MockRandom

Added: head/devel/p5-Test-MockDateTime/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/p5-Test-MockDateTime/Makefile	Mon Nov 14 06:24:05 2016	(r426085)
@@ -0,0 +1,22 @@
+# $FreeBSD$
+
+PORTNAME=	Test-MockDateTime
+PORTVERSION=	0.02
+CATEGORIES=	devel perl5
+MASTER_SITES=	CPAN
+PKGNAMEPREFIX=	p5-
+
+MAINTAINER=	hvo.pm@xs4all.nl
+COMMENT=	Mock DateTime->now calls during tests
+
+LICENSE=	ART10 GPLv1
+LICENSE_COMB=	dual
+
+BUILD_DEPENDS=	p5-DateTime-Format-DateParse>=0:devel/p5-DateTime-Format-DateParse
+RUN_DEPENDS:=	${BUILD_DEPENDS}
+
+USES=		perl5
+USE_PERL5=	configure
+NO_ARCH=	yes
+
+.include <bsd.port.mk>

Added: head/devel/p5-Test-MockDateTime/distinfo
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/p5-Test-MockDateTime/distinfo	Mon Nov 14 06:24:05 2016	(r426085)
@@ -0,0 +1,3 @@
+TIMESTAMP = 1478797177
+SHA256 (Test-MockDateTime-0.02.tar.gz) = c6370a58b9f291fc205121caf92a89865451d49559b0163a8dc7e606f34878dc
+SIZE (Test-MockDateTime-0.02.tar.gz) = 9837

Added: head/devel/p5-Test-MockDateTime/pkg-descr
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/p5-Test-MockDateTime/pkg-descr	Mon Nov 14 06:24:05 2016	(r426085)
@@ -0,0 +1,19 @@
+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: http://search.cpan.org/dist/Test-MockDateTime/

Added: head/devel/p5-Test-MockDateTime/pkg-plist
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/p5-Test-MockDateTime/pkg-plist	Mon Nov 14 06:24:05 2016	(r426085)
@@ -0,0 +1,2 @@
+%%SITE_PERL%%/Test/MockDateTime.pm
+%%PERL5_MAN3%%/Test::MockDateTime.3.gz



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201611140624.uAE6O5cv025784>