Skip to content

Commit

Permalink
Split into two tests
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskim06 committed Apr 6, 2020
1 parent 850dfa0 commit 0c7d67e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions cmd/krew/cmd/namingutils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,17 @@ func Test_allIndexes(t *testing.T) {
if diff := cmp.Diff(expected, actual); diff != "" {
t.Errorf("got diffent output: %s", diff)
}
}

func Test_allIndexes_withMultiIndex(t *testing.T) {
os.Setenv(constants.EnableMultiIndexSwitch, "1")
defer os.Unsetenv(constants.EnableMultiIndexSwitch)

expected = []indexoperations.Index{
tmpDir, cleanup := testutil.NewTempDir(t)
defer cleanup()
paths := environment.NewPaths(tmpDir.Root())

expected := []indexoperations.Index{
{
Name: "custom",
URL: "https://github.com/custom/index.git",
Expand All @@ -154,7 +160,7 @@ func Test_allIndexes(t *testing.T) {
tmpDir.InitEmptyGitRepo(path, index.URL)
}

actual, err = allIndexes(paths)
actual, err := allIndexes(paths)
if err != nil {
t.Errorf("unexpected error getting indexes: %s", err)
}
Expand Down

0 comments on commit 0c7d67e

Please sign in to comment.