Skip to content

Commit 988d3f0

Browse files
Addonosd-yip
authored andcommitted
test(option): Include test cases
1 parent 526918b commit 988d3f0

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

wait-for.bats

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,23 @@
1212
[ "$status" -ne 0 ]
1313
[ "$output" != "success" ]
1414
}
15+
16+
@test "support condensed option style" {
17+
run ./wait-for -qt1 google.com:80 -- echo 'success'
18+
19+
[ "$output" = "success" ]
20+
}
21+
22+
@test "timeout cannot be negative" {
23+
run ./wait-for -t -1 google.com:80 -- echo 'success'
24+
25+
[ "$status" -ne 0 ]
26+
[ "$output" != "success" ]
27+
}
28+
29+
@test "timeout cannot be empty" {
30+
run ./wait-for -t -- google.com:80 -- echo 'success'
31+
32+
[ "$status" -ne 0 ]
33+
[ "$output" != "success" ]
34+
}

0 commit comments

Comments
 (0)