feat: split out test files and execute them manually

This breaks the old grouping mechanism, but honestly that was a weird way of doing it.
This commit is contained in:
Jose Diaz-Gonzalez
2020-06-20 13:22:47 -04:00
parent fb7bac4652
commit 5fd04001d8
39 changed files with 82 additions and 73 deletions

View File

@@ -0,0 +1,47 @@
#!/usr/bin/env bats
load test_helper
setup() {
global_setup
[[ -f ${DOKKU_ROOT}/ENV ]] && mv -f ${DOKKU_ROOT}/ENV ${DOKKU_ROOT}/ENV.bak
sudo -H -u dokku /bin/bash -c "echo 'export global_test=true' > ${DOKKU_ROOT}/ENV"
create_app
}
teardown() {
destroy_app
ls -la ${DOKKU_ROOT}
if [[ -f ${DOKKU_ROOT}/ENV.bak ]];then
mv -f ${DOKKU_ROOT}/ENV.bak ${DOKKU_ROOT}/ENV
fi
global_teardown
}
@test "(config-oddities) set-local/get with multiple spaces and $" {
run /bin/bash -c "dokku config:set --global double_quotes=\"hello world$\" single_quotes='hello$ world'"
echo "output: $output"
echo "status: $status"
run /bin/bash -c "dokku config:get --global double_quotes"
echo "output: $output"
echo "status: $status"
assert_output 'hello world$'
run /bin/bash -c "dokku config:get --global single_quotes"
echo "output: $output"
echo "status: $status"
assert_output 'hello$ world'
assert_success
}
@test "(config-oddities) set-local/get with multiple lines" {
multiline='line one
line two'
run /bin/bash -c "dokku config:set --global double_quotes=\"$multiline\""
echo "output: $output"
echo "status: $status"
run /bin/bash -c "dokku config:get --global double_quotes"
echo "output: $output"
echo "status: $status"
assert_output "$multiline"
assert_success
}