Add export, import and clone commands

This commit is contained in:
Loïc Guitaut
2015-09-13 23:32:05 +02:00
parent 126ce8f8f7
commit 57e4b08158
5 changed files with 139 additions and 11 deletions

29
tests/redis_export.bats Executable file
View File

@@ -0,0 +1,29 @@
#!/usr/bin/env bats
load test_helper
setup() {
export ECHO_DOCKER_COMMAND="false"
dokku "$PLUGIN_COMMAND_PREFIX:create" l >&2
}
teardown() {
export ECHO_DOCKER_COMMAND="false"
dokku --force "$PLUGIN_COMMAND_PREFIX:destroy" l >&2
}
@test "($PLUGIN_COMMAND_PREFIX:export) error when there are no arguments" {
run dokku "$PLUGIN_COMMAND_PREFIX:export"
assert_contains "${lines[*]}" "Please specify a name for the service"
}
@test "($PLUGIN_COMMAND_PREFIX:export) error when service does not exist" {
run dokku "$PLUGIN_COMMAND_PREFIX:export" not_existing_service
assert_contains "${lines[*]}" "service not_existing_service does not exist"
}
@test "($PLUGIN_COMMAND_PREFIX:export) success" {
export ECHO_DOCKER_COMMAND="true"
run dokku "$PLUGIN_COMMAND_PREFIX:export" l
assert_output "docker exec dokku.redis.l cat /data/dump.rdb"
}