From: Matt S Trout Date: Thu, 14 May 2009 22:37:02 +0000 (+0100) Subject: move day delta creation out of case/expect construct X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1dc0a45b2e5009481336560014759ca19a9fe3db;p=engit%2FIron-Munger.git move day delta creation out of case/expect construct --- diff --git a/t/calculate.t b/t/calculate.t index 11626fa..bf4f986 100644 --- a/t/calculate.t +++ b/t/calculate.t @@ -23,7 +23,7 @@ sub named_eq ($test_name, $sub_name, $expected, @posts) { 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); } @@ -37,13 +37,13 @@ sub expect (%expect) { } 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;