From 3e44fa91056e4bdfe51780eed256babb59b9490b Mon Sep 17 00:00:00 2001 From: Yann Hamon Date: Sun, 19 Jun 2022 18:33:02 +0200 Subject: [PATCH] Add test for parsing incorrect flags --- acceptance.bats | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/acceptance.bats b/acceptance.bats index bc8902e..f8ec232 100755 --- a/acceptance.bats +++ b/acceptance.bats @@ -11,6 +11,12 @@ resetCacheFolder() { [ "${lines[0]}" == 'Usage: bin/kubeconform [OPTION]... [FILE OR FOLDER]...' ] } +@test "Fail and display help when using an incorrect flag" { + run bin/kubeconform -xyz + [ "$status" -eq 1 ] + [ "${lines[0]}" == 'flag provided but not defined: -xyz' ] +} + @test "Pass when parsing a valid Kubernetes config YAML file" { run bin/kubeconform -summary fixtures/valid.yaml [ "$status" -eq 0 ]