Acme-MomoiroClover

 view release on metacpan or  search on metacpan

inc/Module/Install.pm  view on Meta::CPAN

	# is unreliable on some platforms and requires write permissions)
	# for now we should catch this and refuse to run.
	if ( -f $0 ) {
		my $s = (stat($0))[9];

		# If the modification time is only slightly in the future,
		# sleep briefly to remove the problem.
		my $a = $s - time;
		if ( $a > 0 and $a < 5 ) { sleep 5 }

		# Too far in the future, throw an error.
		my $t = time;
		if ( $s > $t ) { die <<"END_DIE" }

Your installer $0 has a modification time in the future ($s > $t).

This is known to create infinite loops in make.

Please correct this, then run $0 again.

END_DIE

t/01_members.t  view on Meta::CPAN

use strict;
use Date::Simple;
use Acme::MomoiroClover::Z;
use Test::More tests => 7;
use Test::Exception;

my $momoclo_chan = Acme::MomoiroClover::Z->new;

throws_ok {
    Acme::MomoiroClover->new;
} qr/obsolete/, 'not found yet';

is scalar($momoclo_chan->members),             11, " members(undef) retrieved all";
is scalar($momoclo_chan->members('active')),    5, " members('active')";
is scalar($momoclo_chan->members('graduate')),  6, " members('graduate')";
is scalar($momoclo_chan->members(Date::Simple->new('2011-04-09'))), 6, " members('date_simple_object')";

{
    no warnings 'redefine';
    *Date::Simple::today = sub {
        Date::Simple->new('2011-04-09');
    };
    ok (Acme::MomoiroClover->new), 'can create';
    throws_ok {
        Acme::MomoiroClover::Z->new;
    } qr/not found yet/, 'not found yet';

}



( run in 0.275 second using v1.01-cache-2.11-cpan-496ff517765 )