forked from toolshed/abra
@ -59,8 +59,10 @@ func ValidateRecipe(args []string, cmdName string) recipe.Recipe {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if _, ok := knownRecipes[recipeName]; !ok {
|
if _, ok := knownRecipes[recipeName]; !ok {
|
||||||
|
if !strings.Contains(recipeName, "/") {
|
||||||
log.Fatalf("no recipe '%s' exists?", recipeName)
|
log.Fatalf("no recipe '%s' exists?", recipeName)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
chosenRecipe := recipe.Get(recipeName)
|
chosenRecipe := recipe.Get(recipeName)
|
||||||
if err := chosenRecipe.EnsureExists(); err != nil {
|
if err := chosenRecipe.EnsureExists(); err != nil {
|
||||||
|
@ -22,14 +22,16 @@ teardown(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
@test "retrieve recipe if missing" {
|
@test "retrieve recipe if missing" {
|
||||||
run rm -rf "$ABRA_DIR/recipes/$TEST_RECIPE"
|
if [[ -d "$ABRA_DIR/recipe/custom-html" ]]; then
|
||||||
|
run rm -rf "$ABRA_DIR/recipes/custom-html"
|
||||||
assert_success
|
assert_success
|
||||||
assert_not_exists "$ABRA_DIR/recipes/$TEST_RECIPE"
|
assert_not_exists "$ABRA_DIR/recipes/custom-html"
|
||||||
|
fi
|
||||||
|
|
||||||
run $ABRA recipe lint "$TEST_RECIPE"
|
run $ABRA recipe lint custom-html
|
||||||
assert_success
|
assert_success
|
||||||
|
|
||||||
assert_exists "$ABRA_DIR/recipes/$TEST_RECIPE"
|
assert_exists "$ABRA_DIR/recipes/custom-html"
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "bail if unstaged changes and no --chaos" {
|
@test "bail if unstaged changes and no --chaos" {
|
||||||
|
@ -30,15 +30,17 @@ teardown(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
@test "retrieve recipe if missing" {
|
@test "retrieve recipe if missing" {
|
||||||
run rm -rf "$ABRA_DIR/recipes/$TEST_RECIPE"
|
if [[ -d "$ABRA_DIR/recipe/custom-html" ]]; then
|
||||||
|
run rm -rf "$ABRA_DIR/recipes/custom-html"
|
||||||
assert_success
|
assert_success
|
||||||
assert_not_exists "$ABRA_DIR/recipes/$TEST_RECIPE"
|
assert_not_exists "$ABRA_DIR/recipes/custom-html"
|
||||||
|
fi
|
||||||
|
|
||||||
run $ABRA recipe upgrade "$TEST_RECIPE" --no-input
|
run $ABRA recipe upgrade "custom-html" --no-input
|
||||||
assert_success
|
assert_success
|
||||||
assert_output --partial 'can upgrade service: app'
|
assert_output --partial 'can upgrade service: app'
|
||||||
|
|
||||||
assert_exists "$ABRA_DIR/recipes/$TEST_RECIPE"
|
assert_exists "$ABRA_DIR/recipes/custom-html"
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "error if unstaged changes" {
|
@test "error if unstaged changes" {
|
||||||
|
Reference in New Issue
Block a user