From: Matt S Trout Date: Thu, 14 May 2009 21:39:38 +0000 (+0100) Subject: missing use autobox, die to spot sub name error, code now runs and explodes rather... X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=38827ef4520fca552d126fc040c4e298d9ae17fc;p=engit%2FIron-Munger.git missing use autobox, die to spot sub name error, code now runs and explodes rather than failing to run --- diff --git a/lib/IronMunger/Calculate.pm b/lib/IronMunger/Calculate.pm index a39e374..8c775ce 100644 --- a/lib/IronMunger/Calculate.pm +++ b/lib/IronMunger/Calculate.pm @@ -2,6 +2,7 @@ package IronMunger::Calculate; use strict; use warnings; +use autobox; use autobox::DateTime::Duration; use signatures; @@ -41,7 +42,7 @@ sub successful_sequential_posts (@posts) { return check_both(\&check_post_gap, @posts); } -sub time_remaining_to_post (@posts) { +sub days_remaining_to_post (@posts) { return check_both(\&check_time_remaining, @posts); } diff --git a/t/calculate.t b/t/calculate.t index 0726322..11626fa 100644 --- a/t/calculate.t +++ b/t/calculate.t @@ -2,16 +2,18 @@ use strict; use warnings; use Test::More qw(no_plan); -use autobox::DateTime::Duration; -use signatures; - BEGIN { use_ok 'IronMunger::Post'; use_ok 'IronMunger::Calculate'; } +use autobox; +use autobox::DateTime::Duration; +use signatures; + sub named_eq ($test_name, $sub_name, $expected, @posts) { my $sub_ref = IronMunger::Calculate->can($sub_name); + die "Couldn't find $sub_name in IronMunger::Calculate" unless $sub_ref; my $sub_description = join(' ', split '_', $sub_name); cmp_ok( $sub_ref->(@posts), '==', $expected,