From 0f1faf06a2448cb9c9bf66602ba38c8bd3f3a913 Mon Sep 17 00:00:00 2001 From: Rob Blanckaert Date: Wed, 26 Aug 2015 02:36:48 -0400 Subject: [PATCH] Write a unit test for the tar command. --- tests/unit/tar.bats | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 tests/unit/tar.bats diff --git a/tests/unit/tar.bats b/tests/unit/tar.bats new file mode 100644 index 000000000..286e15a36 --- /dev/null +++ b/tests/unit/tar.bats @@ -0,0 +1,30 @@ +#!/usr/bin/env bats + +load test_helper + +setup() { + create_app +} + +teardown() { + destroy_app +} + +deploy_app_tar() { + APP_TYPE="$1"; APP_TYPE=${APP_TYPE:="nodejs-express"} + GIT_REMOTE="$2"; GIT_REMOTE=${GIT_REMOTE:="dokku@dokku.me:$TEST_APP"} + TMP=$(mktemp -d -t "dokku.me.XXXXX") + rmdir $TMP && cp -r ./tests/apps/$APP_TYPE $TMP + cd $TMP + tar c . | ssh dokku@dokku.me tar:in $TEST_APP || destroy_app $? +} + +@test "(tar) basic deploy using tar:in" { + deploy_app_tar + + run bash -c "response=\"$(curl -s -S my-cool-guy-test-app.dokku.me)\"; echo \$response; test \"\$response\" == \"nodejs/express\"" + echo "output: "$output + echo "status: "$status + assert_success +} +