Bug 37302: Set test to failed if swagger-cli missing
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
parent
82535a4887
commit
be3924a70f
1 changed files with 3 additions and 4 deletions
7
xt/api.t
7
xt/api.t
|
@ -91,14 +91,13 @@ subtest 'The spec passes the swagger-cli validation' => sub {
|
|||
|
||||
plan tests => 1;
|
||||
|
||||
SKIP: {
|
||||
skip "Skipping tests, swagger-cli missing", 1
|
||||
unless can_run('swagger-cli');
|
||||
|
||||
if ( can_run('swagger-cli') ) {
|
||||
my $spec_dir = "$FindBin::Bin/../api/v1/swagger";
|
||||
my $var = qx{swagger-cli validate $spec_dir/swagger.yaml 2>&1};
|
||||
is( $?, 0, 'Validation exit code is 0' )
|
||||
or diag $var;
|
||||
} else {
|
||||
ok( 0, "Test skipped, swagger-cli missing" );
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue