From c82866923c32e5d6edf2d2dcbeef31bb3fd8eebb Mon Sep 17 00:00:00 2001 From: Yann Hamon Date: Sat, 6 Jun 2020 18:31:22 +0200 Subject: [PATCH] update acceptance tests / error mgmt --- acceptance.bats | 2 +- main.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/acceptance.bats b/acceptance.bats index e533d15..4d529e4 100755 --- a/acceptance.bats +++ b/acceptance.bats @@ -37,7 +37,7 @@ @test "Return relevant error for non-existent file" { run bin/kubeconform fixtures/not-here [ "$status" -eq 1 ] - [ $(expr "$output" : "^failed opening fixtures/not-here") -ne 0 ] + [ "$output" = "fixtures/not-here - failed validation: open fixtures/not-here: no such file or directory" ] } @test "Fail when parsing a config with additional properties and strict set" { diff --git a/main.go b/main.go index cc728fa..d6898c0 100644 --- a/main.go +++ b/main.go @@ -227,19 +227,19 @@ func realMain() int { validationResults <- []validationResult{{ filename: filename, err: err, - skipped: true, + skipped: false, }} continue } defer file.Close() - fi, err := file.Stat(); + fi, err := file.Stat() switch { case err != nil: validationResults <- []validationResult{{ filename: filename, err: err, - skipped: true, + skipped: false, }} case fi.IsDir(): @@ -247,7 +247,7 @@ func realMain() int { validationResults <- []validationResult{{ filename: filename, err: err, - skipped: true, + skipped: false, }} }