1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
#!/usr/bin/env perl
use strictures 2;
use Test2::Require::AuthorTesting;
use Test2::V0;
use IPC::Cmd qw();
use JSON::MaybeXS qw();
my $json = JSON::MaybeXS->new(allow_nonref => 1);
my $project = run('create-project', 'name:test-gitlab-api-v4');
run('delete-project', $project->{id});
ok( 1, 'made it to the end' );
done_testing;
sub run {
my($ok, $error, $full, $stdout, $stderr) =
IPC::Cmd::run( command => [$^X, '-I', 'lib', 'script/gitlab-api-v4', @_] );
if ($ok) {
$stdout = join('',@$stdout);
return $json->decode( $stdout );
}
die join('', @$stderr) . $error;
}
1;
|