Skip to content

Commit

Permalink
Fixed the init_test (#200)
Browse files Browse the repository at this point in the history
  • Loading branch information
mathieu-benoit authored Nov 4, 2024
2 parents bce7692 + 18e36bf commit e8c481f
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions internal/command/init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ package command

import (
"context"
"fmt"
"os"
"path/filepath"
"slices"
"strings"
"testing"

Expand All @@ -26,6 +28,7 @@ import (
"github.com/stretchr/testify/require"

"github.com/score-spec/score-compose/internal/project"
"github.com/score-spec/score-compose/internal/provisioners"
"github.com/score-spec/score-compose/internal/provisioners/loader"
)

Expand Down Expand Up @@ -263,6 +266,10 @@ func TestInitWithProvisioners(t *testing.T) {

provs, err := loader.LoadProvisionersFromDirectory(filepath.Join(td, ".score-compose"), loader.DefaultSuffix)
assert.NoError(t, err)
assert.Equal(t, "template://two", provs[0].Uri())
assert.Equal(t, "template://one", provs[1].Uri())
expectedProvisionerUris := []string{"template://one", "template://two"}
for _, expectedUri := range expectedProvisionerUris {
assert.True(t, slices.ContainsFunc(provs, func(p provisioners.Provisioner) bool {
return p.Uri() == expectedUri
}), fmt.Sprintf("Expected provisioner '%s' not found", expectedUri))
}
}

0 comments on commit e8c481f

Please sign in to comment.