use Test::Exception;
BEGIN {
- plan skip_all => "DateTime required" unless eval { require DateTime };
- plan tests => 29;
+ plan tests => 28;
}
BEGIN {
'join' => {dashify => [ '-' ]}
}
);
-
- has datetimes => (
- metaclass => 'Collection::List',
- is => 'rw',
- isa => 'ArrayRef[DateTime]',
- curries => {
- grep => {
- times_with_day => sub {
- my ($self, $body, $datetime) = @_;
- $body->($self, sub { $_->ymd eq $datetime->ymd });
- },
- },
- },
- );
}
my $stuff = Stuff->new(options => [ 1 .. 10 ]);
is($stuff->dashify, '1-2-3-4-5-6-7-8-9-10');
-$stuff->datetimes([
- DateTime->now->subtract(days => 1),
- DateTime->now->subtract(days => 1),
- DateTime->now,
- DateTime->now,
-]);
-
-my $my_time = DateTime->now;
-
-is($stuff->times_with_day($my_time), 2, 'check for currying with a coderef');
-
## test the meta
my $options = $stuff->meta->get_attribute('_options');