Skip to content

Commit

Permalink
test: Create test for passing -- parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
ocean committed Aug 4, 2022
1 parent a562009 commit df2a36f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions testdata/simple.ahoy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,9 @@ ahoyapi: v2
commands:
echo:
cmd: echo "$@"

list:
cmd: ls -a "$@"

whalesay:
cmd: docker run --rm docker/whalesay cowsay -f dragon "$@"
5 changes: 5 additions & 0 deletions tests/simple.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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 ]
}

0 comments on commit df2a36f

Please sign in to comment.