sub case ($name_spec, $case, $expect) {
my $name = join(' ', map ucfirst, split '_', $name_spec);
- my @posts = map { IronMunger::Post->new(at => $_) } @$case;
+ my @posts = map { IronMunger::Post->new(at => $_->days->ago) } @$case;
foreach my $test (sort keys %$expect) {
named_eq($name, $test, $expect->{$test}, @posts);
}
}
case two_posts_ok =>
- [ 5->days->ago, 13->days->ago ],
+ [ 5, 13 ],
expect
sequential => 2,
remaining => 5;
case two_posts_too_far_apart =>
- [ 5->days->ago, 20->days->ago ],
+ [ 5, 20 ],
expect
sequential => 1,
remaining => 5;