Make filesys walk work.

This commit is contained in:
Jeffrey Regan
2019-11-25 16:55:50 -08:00
committed by jregan
parent cb64e19da3
commit c722d4cd17
15 changed files with 1369 additions and 443 deletions

View File

@@ -11,14 +11,19 @@ import (
"sigs.k8s.io/kustomize/api/krusty"
)
func TestSomething1(t *testing.T) {
// TODO: move most of the tests in api/internal/target
// to this package, as they are all high level tests and
// examples appropriate to this level and package.
// The following test isn't much more than a usage example;
// everything is actually tested down in api/internal/target.
func TestSomething(t *testing.T) {
fSys := filesys.MakeFsInMemory()
b := krusty.MakeKustomizer(fSys, krusty.MakeDefaultOptions())
_, err := b.Run("hey")
_, err := b.Run("noSuchThing")
if err == nil {
t.Fatalf("expected error")
}
if err.Error() != "got file 'hey', but 'hey' must be a directory to be a root" {
if err.Error() != "'noSuchThing' doesn't exist" {
t.Fatalf("unexpected error: %v", err)
}
}