forked from toolshed/abra
21
tests/integration/recipe_diff.bats
Normal file
21
tests/integration/recipe_diff.bats
Normal file
@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
setup() {
|
||||
load "$PWD/tests/integration/helpers/common"
|
||||
_common_setup
|
||||
}
|
||||
|
||||
@test "show unstaged changes" {
|
||||
run $ABRA recipe diff "$TEST_RECIPE"
|
||||
assert_success
|
||||
refute_output --partial 'traefik.enable'
|
||||
|
||||
run sed -i '/traefik.enable=.*/d' "$ABRA_DIR/recipes/$TEST_RECIPE/compose.yml"
|
||||
assert_success
|
||||
|
||||
run $ABRA recipe diff "$TEST_RECIPE"
|
||||
assert_success
|
||||
assert_output --partial 'traefik.enable'
|
||||
|
||||
_reset_recipe
|
||||
}
|
25
tests/integration/recipe_reset.bats
Normal file
25
tests/integration/recipe_reset.bats
Normal file
@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
setup() {
|
||||
load "$PWD/tests/integration/helpers/common"
|
||||
_common_setup
|
||||
}
|
||||
|
||||
@test "reset unstaged changes" {
|
||||
run $ABRA recipe fetch "$TEST_RECIPE"
|
||||
assert_success
|
||||
|
||||
run sed -i '/traefik.enable=.*/d' "$ABRA_DIR/recipes/$TEST_RECIPE/compose.yml"
|
||||
assert_success
|
||||
|
||||
run $ABRA recipe diff "$TEST_RECIPE"
|
||||
assert_success
|
||||
assert_output --partial 'traefik.enable'
|
||||
|
||||
run $ABRA recipe reset "$TEST_RECIPE"
|
||||
assert_success
|
||||
|
||||
run $ABRA recipe diff "$TEST_RECIPE"
|
||||
assert_success
|
||||
refute_output --partial 'traefik.enable'
|
||||
}
|
Reference in New Issue
Block a user