test for monger object
Matt S Trout [Fri, 15 May 2009 00:31:54 +0000 (01:31 +0100)]
t/monger.t [new file with mode: 0644]

diff --git a/t/monger.t b/t/monger.t
new file mode 100644 (file)
index 0000000..f1f3dab
--- /dev/null
@@ -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');