test: tag/git helpers & refactor [ci skip]

This commit is contained in:
2023-09-23 23:19:49 +02:00
parent 575bfbb0fb
commit ce7b4733d7
8 changed files with 52 additions and 75 deletions

View File

@ -75,12 +75,11 @@ setup(){
run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" status
refute_output --partial 'behind 3'
_reset_recipe "$TEST_RECIPE"
}
@test "ensure recipe not up to date if --offline" {
latestCommit="$(git -C "$ABRA_DIR/recipes/$TEST_RECIPE" rev-parse --short HEAD)"
refute [ -z "$latestCommit" ];
run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" reset --hard HEAD~3
assert_success
@ -93,11 +92,7 @@ setup(){
run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" status
assert_output --partial 'behind 3'
run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" checkout "$latestCommit"
assert_success
run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" status
refute_output --partial 'behind 3'
_reset_recipe "$TEST_RECIPE"
}
@test "error if missing .env.sample" {