1
0
mirror of https://github.com/thib8956/nginx-proxy synced 2024-11-25 05:16:30 +00:00

TEST: wildcards-hosts.bats - add a test which uses regexp end-of-string

This commit is contained in:
Thomas LEVEIL 2017-01-07 23:50:54 +01:00
parent a3c6a272f1
commit d8658bd8d9

View File

@ -43,8 +43,8 @@ function setup {
@test "[$TEST_FILE] VIRTUAL_HOST=~^foo\.bar\..*\.bats" {
# WHEN
prepare_web_container bats-wildcard-hosts-2 80 -e VIRTUAL_HOST=~^foo\.bar\..*\.bats
dockergen_wait_for_event $SUT_CONTAINER start bats-wildcard-hosts-2
prepare_web_container bats-wildcard-hosts-3 80 -e VIRTUAL_HOST=~^foo\.bar\..*\.bats
dockergen_wait_for_event $SUT_CONTAINER start bats-wildcard-hosts-3
sleep 1
# THEN
@ -55,6 +55,20 @@ function setup {
}
@test "[$TEST_FILE] VIRTUAL_HOST=~^foo\.bar\..*\.bats$" {
# WHEN
prepare_web_container bats-wildcard-hosts-4 80 -e VIRTUAL_HOST=~^foo\.bar\..*\.bats$
dockergen_wait_for_event $SUT_CONTAINER start bats-wildcard-hosts-4
sleep 1
# THEN
assert_200 foo.bar.whatever.bats
assert_200 foo.bar.why.not.bats
assert_503 foo.bar.why.not.bats-to-infinity-and-beyond
assert_503 unexpected.host.bats
}
@test "[$TEST_FILE] stop all bats containers" {
stop_bats_containers
}