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