abra/tests/integration/recipe_sync.bats

40 lines
890 B
Bash

#!/usr/bin/env bash
setup() {
load "$PWD/tests/integration/helpers/common"
_common_setup
}
@test "allow unstaged changes" {
run $ABRA recipe fetch matrix-synapse
assert_success
run echo "unstaged changes" >> "$ABRA_DIR/recipes/matrix-synapse/foo"
assert_success
run git -C "$ABRA_DIR/recipes/matrix-synapse" status
assert_success
assert_output --partial 'foo'
run $ABRA recipe sync matrix-synapse --patch
assert_success
run rm -rf "$ABRA_DIR/recipes/matrix-synapse/foo"
assert_success
assert_not_exists "$ABRA_DIR/recipes/matrix-synapse/foo"
}
@test "detect unstaged label changes" {
run $ABRA recipe fetch matrix-synapse
assert_success
run $ABRA recipe sync matrix-synapse --patch
assert_success
run $ABRA recipe sync matrix-synapse --patch
assert_success
assert_output --partial 'is already set, nothing to do?'
}
# TODO(d1): implement