We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7417f09 commit 6de7025Copy full SHA for 6de7025
pkg/repo/repo_test.go
@@ -19,6 +19,7 @@ package repo
19
import "testing"
20
import "io/ioutil"
21
import "os"
22
+import "strings"
23
24
const testRepositoriesFile = "testdata/repositories.yaml"
25
@@ -215,3 +216,12 @@ func TestWriteFile(t *testing.T) {
215
216
}
217
218
219
+
220
+func TestRepoNotExists(t *testing.T) {
221
+ _, err := LoadRepositoriesFile("/this/path/does/not/exist.yaml")
222
+ if err == nil {
223
+ t.Errorf("expected err to be non-nil when path does not exist")
224
+ } else if !strings.Contains(err.Error(), "You might need to run `helm init`") {
225
+ t.Errorf("expected prompt to run `helm init` when repositories file does not exist")
226
+ }
227
+}
0 commit comments