2017-05-03 10:52:29 +02:00
|
|
|
#!/usr/bin/env bats
|
|
|
|
|
|
|
|
@test "google should be immediately found" {
|
|
|
|
run ./wait-for google.com:80 -- echo 'success'
|
2020-02-03 16:51:44 +01:00
|
|
|
|
2017-05-03 10:52:29 +02:00
|
|
|
[ "$output" = "success" ]
|
|
|
|
}
|
|
|
|
|
|
|
|
@test "nonexistent server should not start command" {
|
|
|
|
run ./wait-for -t 1 noserver:9999 -- echo 'success'
|
|
|
|
|
|
|
|
[ "$status" -ne 0 ]
|
|
|
|
[ "$output" != "success" ]
|
|
|
|
}
|