X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=t%2Ftools.t;h=f871ad07c39a7a221c7062a33b0ed85dbdd4b699;hb=1ea1adc8a16e90ff6ba6a00655b3e02fe7aadfec;hp=ab16348a974da5986ff0abf38d440bf7cc93bf51;hpb=6d34ddc585c5dbd95b6f55aa9d48390376499b64;p=gruntmaster-data.git diff --git a/t/tools.t b/t/tools.t index ab16348..f871ad0 100644 --- a/t/tools.t +++ b/t/tools.t @@ -10,7 +10,7 @@ BEGIN { eval { Gruntmaster::Data::init '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 => 28; + plan tests => 30; } sub fakein { @@ -78,6 +78,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'; @@ -96,6 +101,8 @@ subtest 'gruntmaster-problem add' => sub { ta [qw/-p get pb author/], 'Marius Gavrilescu'; ta [qw/-p set pb owner nobody/]; ta [qw/-p get pb owner/], 'nobody'; +ta [qw/-p set --file pb statement README/]; +like problem_entry('pb')->{statement}, qr/Gruntmaster-Data/, 'gm -p set --file pb statement README'; ta [qw/-p list/], join "\n", sort qw/arc pca rca fca prv pb/; ta [qw/-p rm pb/]; ok !defined problem_entry ('pb'), 'gm -p rm pb';