diff --git a/tests/integration/catalogue.bats b/tests/integration/catalogue.bats index be5e8d57..369567b4 100644 --- a/tests/integration/catalogue.bats +++ b/tests/integration/catalogue.bats @@ -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