From a97a1c8f66db4218f243d3f2b5dc59a9fc18a44b Mon Sep 17 00:00:00 2001 From: Chris Arcand Date: Tue, 14 Sep 2021 15:22:33 -0500 Subject: [PATCH] cloud.MockClient: Use Contains() to implement Search The TFC API doesn't behave this way; a search term just signals the substring was found within the name. --- internal/cloud/tfe_client_mock.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/cloud/tfe_client_mock.go b/internal/cloud/tfe_client_mock.go index d575d82e8d..2dea3096db 100644 --- a/internal/cloud/tfe_client_mock.go +++ b/internal/cloud/tfe_client_mock.go @@ -1103,7 +1103,7 @@ func (m *MockWorkspaces) List(ctx context.Context, organization string, options // Get all the workspaces that match the prefix. var ws []*tfe.Workspace for _, w := range m.workspaceIDs { - if strings.HasPrefix(w.Name, prefix) { + if strings.Contains(w.Name, prefix) { ws = append(ws, w) } }