Merge pull request #1291 from progrium/1261_mh-config-args-refactor

initial pass at config plugin arguments refactor
This commit is contained in:
Michael Hobbs
2015-07-10 07:55:18 -07:00
12 changed files with 151 additions and 95 deletions

View File

@@ -3,13 +3,55 @@
load test_helper
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
rm -f "$DOKKU_ROOT/ENV"
[[ -f $DOKKU_ROOT/ENV.bak ]] && mv -f $DOKKU_ROOT/ENV.bak $DOKKU_ROOT/ENV
}
@test "(config) config:set --global" {
run ssh dokku@dokku.me config:set --global test_var=true test_var2=\"hello world\"
echo "output: "$output
echo "status: "$status
assert_success
}
@test "(config) config:get --global" {
run ssh dokku@dokku.me config:set --global test_var=true test_var2=\"hello world\" test_var3=\"with\\nnewline\"
echo "output: "$output
echo "status: "$status
assert_success
run dokku config:get --global test_var2
echo "output: "$output
echo "status: "$status
assert_output 'hello world'
run dokku config:get --global test_var3
echo "output: "$output
echo "status: "$status
assert_output 'with\nnewline'
}
@test "(config) config:unset --global" {
run ssh dokku@dokku.me config:set --global test_var=true test_var2=\"hello world\"
echo "output: "$output
echo "status: "$status
assert_success
run dokku config:get --global test_var
echo "output: "$output
echo "status: "$status
assert_success
run dokku config:unset --global test_var
echo "output: "$output
echo "status: "$status
assert_success
run dokku config:get --global test_var
echo "output: "$output
echo "status: "$status
assert_output ""
}
@test "(config) config:set" {