Skip to content

Commit

Permalink
test(option): Include test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
Addono authored and sd-yip committed Feb 1, 2021
1 parent 526918b commit 988d3f0
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions wait-for.bats
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,23 @@
[ "$status" -ne 0 ]
[ "$output" != "success" ]
}

@test "support condensed option style" {
run ./wait-for -qt1 google.com:80 -- echo 'success'

[ "$output" = "success" ]
}

@test "timeout cannot be negative" {
run ./wait-for -t -1 google.com:80 -- echo 'success'

[ "$status" -ne 0 ]
[ "$output" != "success" ]
}

@test "timeout cannot be empty" {
run ./wait-for -t -- google.com:80 -- echo 'success'

[ "$status" -ne 0 ]
[ "$output" != "success" ]
}

0 comments on commit 988d3f0

Please sign in to comment.