From 5dcbe2d820974c300ca2e537db43a33512be4363 Mon Sep 17 00:00:00 2001 From: "Jonathan \"Duke\" Leto" Date: Wed, 5 Jan 2011 12:46:34 -0800 Subject: Add a few more simple tests --- t/builder.t | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 't/builder.t') diff --git a/t/builder.t b/t/builder.t index c952c12..685ad57 100644 --- a/t/builder.t +++ b/t/builder.t @@ -1,15 +1,31 @@ use strict; use warnings; -use Test::More tests => 3; +use Test::Most tests => 6; use jitterbug::Builder; { - local @ARGV = qw(-c blarg.yml); + local @ARGV = qw(-c foo.yml -C); my $b = jitterbug::Builder->new(); isa_ok($b,'jitterbug::Builder'); - is($b->{'configfile'}, 'blarg.yml'); - can_ok($b,'run'); + can_ok($b,qw/run build run_task sleep/); + + is($b->{'configfile'}, 'foo.yml'); + is($b->{'cron'}, 1 ); +} + +{ + local @ARGV = qw(-c blarg.yml -C); + my $b = jitterbug::Builder->new(); + + throws_ok (sub {$b->run}, qr/YAML Error/i, 'nonexistent yaml file throws error'); +} + +{ + local @ARGV = qw(-c t/data/test.yml -C); + my $b = jitterbug::Builder->new(); + is($b->run, 0, '->run returns 0 in cron mode'); + } -- cgit 1.4.1