X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=t%2Ftools.t;h=6a08457cf960816b2a3450fb08b6170e3fa8fbcb;hb=13af733e3f3f26ce7cee8d1f2154f82c93f4c3c3;hp=45c0e8f994e5543b9a1c20fcf77b7ff8e5020f4e;hpb=096c7331093f3d1c3d820d440d44edb352a31b67;p=gruntmaster-data.git diff --git a/t/tools.t b/t/tools.t index 45c0e8f..6a08457 100644 --- 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';