]> iEval git - gruntmaster-data.git/blobdiff - t/tools.t
Do not crash in t/tools.t if postgres is not running
[gruntmaster-data.git] / t / tools.t
index 45c0e8f994e5543b9a1c20fcf77b7ff8e5020f4e..6a08457cf960816b2a3450fb08b6170e3fa8fbcb 100644 (file)
--- a/t/tools.t
+++ b/t/tools.t
@@ -8,9 +8,11 @@ use App::Cmd::Tester;
 
 BEGIN {
        eval {
-               Gruntmaster::Data::init 'dbi:Pg:dbname=gmtest'; 1;
+               dbinit 'dbi:Pg:dbname=gmtest'; 1;
        } or plan skip_all => 'Cannot connect to test database. Create it by running make_test_db.sh before running this test. '. "Error: $@";
-       plan tests => 29;
+       no warnings 'redefine';
+       *Gruntmaster::App::dbinit = sub {}; # Prevent reinit in Gruntmaster::App->run
+       plan tests => 30;
 }
 
 sub fakein {
@@ -78,6 +80,11 @@ EOF
 
 ta [qw/-p add pb/];
 
+{
+       my $out = ta([qw/-p show pb/])->output;
+       like $out, qr/Value \(points\): 250/, 'gm -p show pb contains Value'
+}
+
 subtest 'gruntmaster-problem add' => sub {
        plan tests => 10;
        my $pb = problem_entry 'pb';
This page took 0.009856 seconds and 4 git commands to generate.