Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
koba1t committed Feb 8, 2023
1 parent 53a4134 commit cd49194
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions kustomize/commands/edit/add/addcomponent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func TestAddComponentHappyPath(t *testing.T) {
}

func TestAddComponentAlreadyThere(t *testing.T) {
fSys := filesys.MakeFsInMemory()
fSys := filesys.MakeEmptyDirInMemory()
err := fSys.WriteFile(componentFileName, []byte(componentFileContent))
require.NoError(t, err)
testutils_test.WriteTestKustomization(fSys)
Expand All @@ -52,7 +52,7 @@ func TestAddComponentAlreadyThere(t *testing.T) {
}

func TestAddKustomizationFileAsComponent(t *testing.T) {
fSys := filesys.MakeFsInMemory()
fSys := filesys.MakeEmptyDirInMemory()
err := fSys.WriteFile(componentFileName, []byte(componentFileContent))
require.NoError(t, err)
testutils_test.WriteTestKustomization(fSys)
Expand All @@ -63,7 +63,7 @@ func TestAddKustomizationFileAsComponent(t *testing.T) {

content, err := testutils_test.ReadTestKustomization(fSys)
require.NoError(t, err)
assert.NotContains(t, string(content), componentFileName)
assert.Contains(t, string(content), componentFileName)
}

func TestAddComponentNoArgs(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions kustomize/commands/edit/add/addresource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ replacements:
}

func TestAddResourceAlreadyThere(t *testing.T) {
fSys := filesys.MakeFsInMemory()
fSys := filesys.MakeEmptyDirInMemory()
err := fSys.WriteFile(resourceFileName, []byte(resourceFileContent))
require.NoError(t, err)
testutils_test.WriteTestKustomization(fSys)
Expand All @@ -71,7 +71,7 @@ func TestAddResourceAlreadyThere(t *testing.T) {
}

func TestAddKustomizationFileAsResource(t *testing.T) {
fSys := filesys.MakeFsInMemory()
fSys := filesys.MakeEmptyDirInMemory()
err := fSys.WriteFile(resourceFileName, []byte(resourceFileContent))
require.NoError(t, err)
testutils_test.WriteTestKustomization(fSys)
Expand All @@ -83,7 +83,7 @@ func TestAddKustomizationFileAsResource(t *testing.T) {
content, err := testutils_test.ReadTestKustomization(fSys)
assert.NoError(t, err)

assert.NotContains(t, string(content), resourceFileName)
assert.Contains(t, string(content), resourceFileName)
}

func TestAddResourceNoArgs(t *testing.T) {
Expand Down

0 comments on commit cd49194

Please sign in to comment.