(t *testing.T)
| 77 | } |
| 78 | |
| 79 | func TestValidateInvalidInputs(t *testing.T) { |
| 80 | var tests = []string{ |
| 81 | "missing_kind.yaml", |
| 82 | "missing_kind_value.yaml", |
| 83 | "duplicates.yaml", |
| 84 | "duplicates-non-namespaced.yaml", |
| 85 | "duplicates-with-namespace.yaml", |
| 86 | } |
| 87 | for _, test := range tests { |
| 88 | filePath, _ := filepath.Abs("../fixtures/" + test) |
| 89 | fileContents, _ := ioutil.ReadFile(filePath) |
| 90 | config := NewDefaultConfig() |
| 91 | config.DefaultNamespace = "the-default-namespace" |
| 92 | config.FileName = test |
| 93 | _, err := Validate(fileContents, config) |
| 94 | if err == nil { |
| 95 | t.Errorf("Validate should not pass when testing invalid configuration in " + test) |
| 96 | } |
| 97 | } |
| 98 | } |
| 99 | |
| 100 | func TestValidateSourceExtraction(t *testing.T) { |
| 101 | expectedFileNames := []string{ |
nothing calls this directly
no test coverage detected