diff --git a/main_init_test.go b/main_init_test.go index 6731065..523860e 100644 --- a/main_init_test.go +++ b/main_init_test.go @@ -16,6 +16,7 @@ package main import ( "context" + "fmt" "os" "path/filepath" "strings" @@ -150,7 +151,17 @@ func TestInitWithProvisioners(t *testing.T) { provs, err := loader.LoadProvisionersFromDirectory(filepath.Join(td, ".score-k8s"), loader.DefaultSuffix) assert.NoError(t, err) if assert.Greater(t, len(provs), 2) { - assert.Equal(t, "template://two", provs[0].Uri()) - assert.Equal(t, "template://one", provs[1].Uri()) + expectedProvisioners := map[string]bool{ + "template://one": true, + "template://two": true, + } + for _, prov := range provs { + if _, found := expectedProvisioners[prov.Uri()]; found { + delete(expectedProvisioners, prov.Uri()) + } + } + for provisioner := range expectedProvisioners { + assert.Fail(t, fmt.Sprintf("Expected provisioner '%s' not found", provisioner)) + } } }