test: ensure catalogue --chaos works [ci skip]

Closes coop-cloud/organising#462.
This commit is contained in:
decentral1se 2023-09-20 14:15:43 +02:00
parent d5593b69e0
commit e116148c49
Signed by: decentral1se
GPG Key ID: 03789458B3D0C410
1 changed files with 26 additions and 0 deletions

View File

@ -11,6 +11,32 @@ setup(){
assert_success
}
@test "error if unstaged changes" {
run bash -c "echo foo >> $ABRA_DIR/catalogue/foo"
assert_success
assert_exists "$ABRA_DIR/catalogue/foo"
run $ABRA catalogue generate
assert_failure
assert_output --partial 'locally unstaged changes'
run rm -rf "$ABRA_DIR/catalogue/foo"
assert_not_exists "$ABRA_DIR/catalogue/foo"
}
# bats test_tags=slow
@test "no error if unstaged and --chaos" {
run bash -c "echo foo >> $ABRA_DIR/catalogue/foo"
assert_success
assert_exists "$ABRA_DIR/catalogue/foo"
run $ABRA catalogue generate gitea --chaos
assert_success
run rm -rf "$ABRA_DIR/catalogue/foo"
assert_not_exists "$ABRA_DIR/catalogue/foo"
}
# bats test_tags=slow
@test "generate only specific recipe" {
run $ABRA catalogue generate gitea