cli/api: Update plugin listing to always include version info in the response (#17347)

This commit is contained in:
Tom Proctor
2022-09-29 18:22:33 +01:00
committed by GitHub
parent 6771e564d4
commit d467681e15
7 changed files with 161 additions and 90 deletions

View File

@@ -1,6 +1,7 @@
package command
import (
"regexp"
"strings"
"testing"
@@ -36,7 +37,7 @@ func TestPluginListCommand_Run(t *testing.T) {
{
"lists",
nil,
"Plugins",
"Name\\s+Type\\s+Version",
0,
},
}
@@ -62,7 +63,8 @@ func TestPluginListCommand_Run(t *testing.T) {
}
combined := ui.OutputWriter.String() + ui.ErrorWriter.String()
if !strings.Contains(combined, tc.out) {
matcher := regexp.MustCompile(tc.out)
if !matcher.MatchString(combined) {
t.Errorf("expected %q to contain %q", combined, tc.out)
}
})