fix: `kn source list` command print spelling problems (#963)

This commit is contained in:
tianfeiyu 2020-08-05 17:49:28 +08:00 committed by GitHub
parent 49a552f155
commit 7f2de9eb9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -73,7 +73,7 @@ func NewListCommand(p *commands.KnParams) *cobra.Command {
} }
if sourceList == nil || len(sourceList.Items) == 0 { if sourceList == nil || len(sourceList.Items) == 0 {
fmt.Fprintf(cmd.OutOrStdout(), "No sources found in %s namespace.\n", namespace) fmt.Fprintf(cmd.OutOrStdout(), "No sources found.\n")
return nil return nil
} }
// empty namespace indicates all namespaces flag is specified // empty namespace indicates all namespaces flag is specified

View File

@ -64,7 +64,7 @@ func TestSourceList(t *testing.T) {
t.Log("List sources empty case") t.Log("List sources empty case")
output := sourceList(r) output := sourceList(r)
assert.Check(t, util.ContainsAll(output, "No", "sources", "found", "namespace")) assert.Check(t, util.ContainsAll(output, "No", "sources", "found."))
assert.Check(t, util.ContainsNone(output, "NAME", "TYPE", "RESOURCE", "SINK", "READY")) assert.Check(t, util.ContainsNone(output, "NAME", "TYPE", "RESOURCE", "SINK", "READY"))
t.Log("Create API Server") t.Log("Create API Server")
@ -86,9 +86,9 @@ func TestSourceList(t *testing.T) {
t.Log("List sources filter invalid case") t.Log("List sources filter invalid case")
output = sourceList(r, "--type", "testapisource0") output = sourceList(r, "--type", "testapisource0")
assert.Check(t, util.ContainsAll(output, "No", "sources", "found", "namespace")) assert.Check(t, util.ContainsAll(output, "No", "sources", "found."))
output = sourceList(r, "--type", "TestSource", "-oyaml") output = sourceList(r, "--type", "TestSource", "-oyaml")
assert.Check(t, util.ContainsAll(output, "No", "sources", "found", "namespace")) assert.Check(t, util.ContainsAll(output, "No", "sources", "found."))
t.Log("List available source in YAML format") t.Log("List available source in YAML format")
output = sourceList(r, "--type", "PingSource,ApiServerSource", "-oyaml") output = sourceList(r, "--type", "PingSource,ApiServerSource", "-oyaml")