summary refs log tree commit diff
path: root/t
diff options
context:
space:
mode:
Diffstat (limited to 't')
-rw-r--r--t/005_builder.t37
-rw-r--r--t/006_runner.t24
2 files changed, 34 insertions, 27 deletions
diff --git a/t/005_builder.t b/t/005_builder.t
index 15795d6..24f1e13 100644
--- a/t/005_builder.t
+++ b/t/005_builder.t
@@ -1,44 +1,27 @@
 
 use strict;
 use warnings;
-use Test::Most tests => 7;
+use Test::Most tests => 2;
 use Data::Dumper;
 
-use jitterbug::Builder;
+use jitterbug::Runner;
 
 {
-    local @ARGV = qw(-c t/data/test.yml -C);
-    my $b = jitterbug::Builder->new();
+    local @ARGV = qw(-c t/data/test.yml);
+    my $r = jitterbug::Runner->new();
+    isa_ok($r, 'jitterbug::Runner');
+    warn Dumper [ $r ];
+    is($r->{'configfile'}, 't/data/test.yml');
 
-    isa_ok($b,'jitterbug::Builder');
-    can_ok($b,qw/run build run_task sleep/);
+    system("$^X scripts/deploy_schema t/data/test.yml");
 
-    is($b->{'configfile'}, 't/data/test.yml');
-    is($b->{'cron'}, 1 );
-}
-
-{
-    local @ARGV = qw(-c blarg.yml -C);
+    is($r->run, 0, '->run returns 0 in cron mode');
 
-    throws_ok (sub {
-        my $b = jitterbug::Builder->new();
-    }, qr/Does not exist/i, 'nonexistent yaml file throws error');
-}
-
-{
-    local @ARGV = qw(-c t/data/test.yml -C);
-    my $b = jitterbug::Builder->new();
-    isa_ok($b, 'jitterbug::Builder');
-    is($b->{'configfile'}, 't/data/test.yml');
-    #warn Dumper [ $b ];
-
-    is($b->run, 0, '->run returns 0 in cron mode');
-    cmp_deeply($b->{'conf'}, {
+    cmp_deeply($r->{'conf'}, {
         'configfile' => 't/data/test.yml',
         'cron'       => 1,
         'sleep'      => undef
     });
 
-
 }
 
diff --git a/t/006_runner.t b/t/006_runner.t
new file mode 100644
index 0000000..b95abb2
--- /dev/null
+++ b/t/006_runner.t
@@ -0,0 +1,24 @@
+
+use strict;
+use warnings;
+use Test::Most tests => 3;
+use Data::Dumper;
+
+use jitterbug::Runner;
+
+{
+    local @ARGV = qw(-c t/data/test.yml);
+    my $b = jitterbug::Runner->new();
+
+    isa_ok($b,'jitterbug::Runner');
+    can_ok($b,qw/new run run_task sleep/);
+
+}
+
+{
+    local @ARGV = qw(-c blarg.yml);
+    throws_ok (sub {
+        my $b = jitterbug::Runner->new('blarg.yml');
+    }, qr/Does not exist/i, 'nonexistent yaml file throws error');
+}
+