forked from toolshed/abra
test: moar integration tests [ci skip]
This commit is contained in:
@ -1,38 +1,37 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
setup() {
|
||||
DIR="$( cd "$( dirname "$BATS_TEST_FILENAME" )" >/dev/null 2>&1 && pwd )"
|
||||
source "$DIR/helpers.sh"
|
||||
_setup_env
|
||||
load "$PWD/tests/integration/helpers/common"
|
||||
_common_setup
|
||||
|
||||
if [[ -f "$HOME/.local/bin/abra" ]]; then
|
||||
mv "$HOME/.local/bin/abra" "$HOME/.local/bin/abra_before_test"
|
||||
fi
|
||||
}
|
||||
|
||||
@test "install from script" {
|
||||
run bash -c 'curl https://install.abra.coopcloud.tech | bash'
|
||||
assert_success
|
||||
|
||||
assert [ -f "$HOME/.local/bin/abra" ]
|
||||
run $HOME/.local/bin/abra -v
|
||||
assert_output --partial 'beta'
|
||||
}
|
||||
|
||||
@test "install release candidate from script" {
|
||||
run bash -c 'curl https://install.abra.coopcloud.tech | bash -s -- --rc'
|
||||
assert_success
|
||||
|
||||
assert [ -f "$HOME/.local/bin/abra" ]
|
||||
run $HOME/.local/bin/abra -v
|
||||
assert_output --partial '-rc'
|
||||
}
|
||||
|
||||
teardown(){
|
||||
_default_teardown
|
||||
|
||||
if [[ -f "$HOME/.local/bin/abra_before_test" ]]; then
|
||||
rm -rf "$HOME/.local/bin/abra"
|
||||
mv "$HOME/.local/bin/abra_before_test" "$HOME/.local/bin/abra"
|
||||
fi
|
||||
}
|
||||
|
||||
# bats test_tags=slow
|
||||
@test "install from script" {
|
||||
run bash -c 'curl https://install.abra.coopcloud.tech | bash'
|
||||
assert_success
|
||||
|
||||
assert_exists "$HOME/.local/bin/abra"
|
||||
run "$HOME/.local/bin/abra" -v
|
||||
assert_output --partial 'beta'
|
||||
}
|
||||
|
||||
# bats test_tags=slow
|
||||
@test "install release candidate from script" {
|
||||
run bash -c 'curl https://install.abra.coopcloud.tech | bash -s -- --rc'
|
||||
assert_success
|
||||
|
||||
assert_exists "$HOME/.local/bin/abra"
|
||||
run "$HOME/.local/bin/abra" -v
|
||||
assert_output --partial '-rc'
|
||||
}
|
||||
|
Reference in New Issue
Block a user