Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Perl Module for check a time is recent
Perl
tag: 1.01

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
inc/Module
lib/Test
t
xt
.gitignore
CHANGES
MANIFEST
MANIFEST.skip
META.yml
Makefile.PL
README

README

NAME
    Test::Recent - check a time is recent

SYNOPSIS
       use Test::More;
       use Test::Recent qw(recent);

       # check things happened in the last ten seconds
       recent DateTime->now, "now is recent!";
       recent "2012-12-23 00:00:00", "end of mayan calendar happened recently?";
       recent "5 seconds ago", "5 seconds ago is obviously recently";

       # check things happened in the last hour
       recent "2012-12-23 00:00:00", DateTime::Duration->new( hours => 1 ), "mayan";
       recent "2012-12-23 00:00:00", "1 hour", "mayan"

DESCRIPTION
    Simple module to check things happened recently. Uses DateTimeX::Easy
    and Time::Duration::Parse do parse the times and durations.

  Functions
    These are exported on demand or may be called fully qualified

    recent $time
    recent $time, $test_description
    recent $time, $duration, $test_description
        Tests (using the Test::Builder framework) if the time occured within
        the duration ago from the current time. If no duration is passed,
        ten seconds is assumed.

    occured_within_ago $time, $duration
        Returns true if and only if the time occured within the duration ago
        from the current time.

AUTHOR
    Written by Mark Fowler <mark@twoshortplanks.com>

COPYRIGHT
    Copyright OmniTI 2012. All Rights Rerserved.

    This program is free software; you can redistribute it and/or modify it
    under the same terms as Perl itself.

BUGS
    Bugs should be reported via this distribution's CPAN RT queue. This can
    be found at <https://rt.cpan.org/Dist/Display.html?Test-Recent>

    You can also address issues by forking this distribution on github and
    sending pull requests. It can be found at
    <http://github.com/2shortplanks/Test-Recent>

SEE ALSO
    DateTimeX::Easy, Time::Duration::Parse

Something went wrong with that request. Please try again.