forked from toolshed/abra
test: moar integration tests [ci skip]
This commit is contained in:
36
tests/integration/server_remove.bats
Normal file
36
tests/integration/server_remove.bats
Normal file
@ -0,0 +1,36 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
setup_file(){
|
||||
load "$PWD/tests/integration/helpers/common"
|
||||
_common_setup
|
||||
_add_server
|
||||
}
|
||||
|
||||
teardown_file(){
|
||||
_rm_server
|
||||
}
|
||||
|
||||
setup(){
|
||||
load "$PWD/tests/integration/helpers/common"
|
||||
_common_setup
|
||||
}
|
||||
|
||||
@test "validate server" {
|
||||
run $ABRA server remove --no-input
|
||||
assert_failure
|
||||
assert_output --partial 'no server provided'
|
||||
|
||||
run $ABRA server remove foo
|
||||
assert_failure
|
||||
assert_output --partial "server doesn't exist"
|
||||
}
|
||||
|
||||
@test "remove server" {
|
||||
assert_exists "$ABRA_DIR/servers/$TEST_SERVER"
|
||||
assert bash -c "docker context ls | grep -q $TEST_SERVER"
|
||||
|
||||
run $ABRA server remove --no-input "$TEST_SERVER"
|
||||
assert_success
|
||||
assert_not_exists "$ABRA_DIR/servers/$TEST_SERVER"
|
||||
refute bash -c "docker context ls | grep -q $TEST_SERVER"
|
||||
}
|
Reference in New Issue
Block a user