Subject: | suggest mock Date::Calc too |
Date: | Thu, 12 Feb 2009 06:24:42 +1100 |
To: | bug-Test-MockTime [...] rt.cpan.org |
From: | Kevin Ryde <user42 [...] zip.com.au> |
I'd be good if Test::MockTime could jig up overrides for the Date::Calc
current time funcs too. The basic ones I spot are (among which I've
been using Today() ...),
System_Clock
Today
Now
Today_and_Now
This_Year
And a couple default to the current time and so would want the fake
current time substituted,
Gmtime
Localtime
(They're all xsubs, so don't go through the CORE:: overrides already.)
The various other Date::Calc funcs might be able to do most of the
actual work, starting from a time_t for the faked current time.
It'd be tempting to have Test::MockTime mangle Date::Calc automatically
if it's loaded, or mangle when later loaded (if that's feasible).
Otherwise an option to load and mangle could be ok if that's easier or
more reliable (esp if other modules import Date::Calc funcs).