subcommand restructure and bashstyle refactor. closes #1579

This commit is contained in:
Michael S. Hobbs
2016-03-01 13:26:35 -08:00
committed by Michael Hobbs
parent 76e27f0333
commit 89f289b433
105 changed files with 1969 additions and 1306 deletions

View File

@@ -2,20 +2,15 @@
load test_helper
@test "(apps) apps" {
create_app
run bash -c "dokku apps | grep $TEST_APP"
echo "output: "$output
echo "status: "$status
assert_output $TEST_APP
destroy_app
}
@test "(apps) apps:create" {
run dokku apps:create $TEST_APP
echo "output: "$output
echo "status: "$status
assert_success
run bash -c "dokku apps | grep $TEST_APP"
echo "output: "$output
echo "status: "$status
assert_output $TEST_APP
destroy_app
run dokku apps:create 1994testapp
@@ -28,6 +23,17 @@ load test_helper
echo "output: "$output
echo "status: "$status
assert_failure
run bash -c "dokku --app $TEST_APP apps:create"
echo "output: "$output
echo "status: "$status
assert_success
run bash -c "dokku apps | grep $TEST_APP"
echo "output: "$output
echo "status: "$status
assert_output $TEST_APP
destroy_app
}
@test "(apps) apps:destroy" {
@@ -36,6 +42,12 @@ load test_helper
echo "output: "$output
echo "status: "$status
assert_success
create_app
run bash -c "dokku --force --app $TEST_APP apps:destroy"
echo "output: "$output
echo "status: "$status
assert_success
}
@test "(apps) apps:rename" {

View File

@@ -57,26 +57,36 @@ teardown() {
assert_output ""
}
@test "(config) config:set" {
run ssh dokku@dokku.me config:set $TEST_APP test_var=true test_var2=\"hello world\"
@test "(config) config:set/get" {
run ssh dokku@dokku.me config:set $TEST_APP test_var1=true test_var2=\"hello world\"
echo "output: "$output
echo "status: "$status
assert_success
run bash -c "dokku config:get $TEST_APP test_var1 | grep true"
echo "output: "$output
echo "status: "$status
assert_output "true"
run bash -c "dokku config:get $TEST_APP test_var2 | grep 'hello world'"
echo "output: "$output
echo "status: "$status
assert_output "hello world"
}
@test "(config) config:get" {
run ssh dokku@dokku.me config:set $TEST_APP test_var=true test_var2=\"hello world\" test_var3=\"with\\nnewline\"
@test "(config) config:set/get (with --app)" {
run bash -c "dokku --app $TEST_APP config:set test_var1=true test_var2=\"hello world\""
echo "output: "$output
echo "status: "$status
assert_success
run dokku config:get $TEST_APP test_var2
run bash -c "dokku --app $TEST_APP config:get test_var1 | grep true"
echo "output: "$output
echo "status: "$status
assert_output 'hello world'
run dokku config:get $TEST_APP test_var3
assert_output "true"
run bash -c "dokku --app $TEST_APP config:get test_var2 | grep 'hello world'"
echo "output: "$output
echo "status: "$status
assert_output 'with\nnewline'
assert_output "hello world"
}
@test "(config) config:unset" {
@@ -87,7 +97,7 @@ teardown() {
run dokku config:get $TEST_APP test_var
echo "output: "$output
echo "status: "$status
assert_success
assert_output "true"
run dokku config:unset $TEST_APP test_var
echo "output: "$output
echo "status: "$status