File: gitlab-api-v4.t

package info (click to toggle)
libgitlab-api-v4-perl 0.27-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,500 kB
  • sloc: perl: 5,960; sh: 838; python: 63; makefile: 12
file content (31 lines) | stat: -rwxr-xr-x 621 bytes parent folder | download
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;