From: Matt S Trout Date: Fri, 15 May 2009 00:31:54 +0000 (+0100) Subject: test for monger object X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f2dad6bd4ae84da8554d30d244f78c23a2b28b08;p=engit%2FIron-Munger.git test for monger object --- diff --git a/t/monger.t b/t/monger.t new file mode 100644 index 0000000..f1f3dab --- /dev/null +++ b/t/monger.t @@ -0,0 +1,14 @@ +use strict; +use warnings; +use Test::More qw(no_plan); +use aliased 'IronMunger::Monger'; +use aliased 'IronMunger::Post'; +use autobox; +use autobox::DateTime::Duration; + +my $monger = Monger->new( + posts => [ map { Post->new(at => $_->days->ago) } (2, 10) ] +); + +cmp_ok($monger->days_left, '==', 8, 'Eight days to post'); +cmp_ok($monger->post_count, '==', 2, 'Two sequential posts');