forked from toolshed/abra
refactor(recipe): remove direct usage of config.RECIPE_DIR
This commit is contained in:
@ -1,7 +1,6 @@
|
||||
package envfile_test
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"reflect"
|
||||
"slices"
|
||||
"strings"
|
||||
@ -61,8 +60,7 @@ func TestReadAbraShEnvVars(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
abraShPath := fmt.Sprintf("%s/%s/%s", config.RECIPES_DIR, r.Name, "abra.sh")
|
||||
abraShEnv, err := envfile.ReadAbraShEnvVars(abraShPath)
|
||||
abraShEnv, err := envfile.ReadAbraShEnvVars(r.AbraShPath)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@ -91,8 +89,7 @@ func TestReadAbraShCmdNames(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
abraShPath := fmt.Sprintf("%s/%s/%s", config.RECIPES_DIR, r.Name, "abra.sh")
|
||||
cmdNames, err := appPkg.ReadAbraShCmdNames(abraShPath)
|
||||
cmdNames, err := appPkg.ReadAbraShCmdNames(r.AbraShPath)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@ -104,7 +101,7 @@ func TestReadAbraShCmdNames(t *testing.T) {
|
||||
expectedCmdNames := []string{"test_cmd", "test_cmd_args"}
|
||||
for _, cmdName := range expectedCmdNames {
|
||||
if !slices.Contains(cmdNames, cmdName) {
|
||||
t.Fatalf("%s should have been found in %s", cmdName, abraShPath)
|
||||
t.Fatalf("%s should have been found in %s", cmdName, r.AbraShPath)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user