// TestGetFromDirectory tests the GetFromDirectory method to validate that the kustomization
// yaml file was marshaled correctly from the provided path
TestGetFromDirectory tests the GetFromDirectory method to validate that the kustomization
yaml file was marshaled correctly from the provided path
// TestGetFromDirectory tests the GetFromDirectory method to validate that the kustomization // yaml file was marshaled correctly from the provided path
func TestGetFromDirectory(t *testing.T) {
	   /app
	   └── kustomization.yaml
	fakeFileSystem := afero.NewMemMapFs()
	fakeFileSystem.Mkdir("app", 0755)
	fileContents := `
resources:
- a.yaml
`
	afero.WriteFile(fakeFileSystem, "app/kustomization.yaml", []byte(fileContents), 0644)
	kustomizationFile, _ := NewFromFileSystem(fakeFileSystem).GetFromDirectory("app")
	expected := "a.yaml"
	actual := kustomizationFile.Resources[0]
	if actual != expected {
		t.Errorf("Returned wrong resources, got %s, want: %s", actual, expected)
	}
}
func TestGetFromDirectory ( t * testing . T ) { fakeFileSystem := afero . NewMemMapFs ( ) fakeFileSystem . Mkdir ( " " , 0755 ) fileContents := `
resources:
- a.yaml
` afero . WriteFile ( fakeFileSystem , " " , [ ] byte ( fileContents ) , 0644 ) kustomizationFile , _ := NewFromFileSystem ( fakeFileSystem ) . GetFromDirectory ( " " ) expected := " " actual := kustomizationFile . Resources [ 0 ] if actual != expected { t . Errorf ( " " , actual , expected ) } }
TestGetFromDirectory tests the GetFromDirectory method to validate that the kustomization
yaml file was marshaled correctly from the provided path
TestGetFromDirectory tests the GetFromDirectory method to validate that the kustomization yaml file was marshaled correctly from the provided path
// Folder structure for this test // //   /app //   └── kustomization.yaml