From 3a79145acb080f71e714c6b3b7a545fb51dd60d1 Mon Sep 17 00:00:00 2001 From: Drew Robinson Date: Thu, 4 Aug 2022 17:26:57 +1000 Subject: [PATCH] test: Create test for passing `--` parameter --- testdata/simple.ahoy.yml | 6 ++++++ tests/simple.bats | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/testdata/simple.ahoy.yml b/testdata/simple.ahoy.yml index 26c038e..f7d342a 100644 --- a/testdata/simple.ahoy.yml +++ b/testdata/simple.ahoy.yml @@ -2,3 +2,9 @@ ahoyapi: v2 commands: echo: cmd: echo "$@" + + list: + cmd: ls -a "$@" + + whalesay: + cmd: docker run --rm docker/whalesay cowsay -f dragon "$@" diff --git a/tests/simple.bats b/tests/simple.bats index adcab3a..e90ffdd 100644 --- a/tests/simple.bats +++ b/tests/simple.bats @@ -13,3 +13,8 @@ result="$(./ahoy -f testdata/simple.ahoy.yml echo something)" [ "$result" == "something" ] } + +@test "run a simple ahoy command (ls -a) with an extra parameter (-l)" { + run ./ahoy -f testdata/simple.ahoy.yml list -- -l + [ "${#lines[@]}" -gt 13 ] +}