Skip to content

Commit

Permalink
e2e: start a new file for cli plugins arguments tests
Browse files Browse the repository at this point in the history
`TestRunGoodArgument` fits here.

Signed-off-by: Ian Campbell <[email protected]>
  • Loading branch information
Ian Campbell committed Mar 11, 2019
1 parent fdb0ef7 commit 60a4806
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 12 deletions.
19 changes: 19 additions & 0 deletions e2e/cli-plugins/flags_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package cliplugins

import (
"testing"

"gotest.tools/icmd"
)

// TestRunGoodArgument ensures correct behaviour when running a valid plugin with an `--argument`.
func TestRunGoodArgument(t *testing.T) {
run, _, cleanup := prepare(t)
defer cleanup()

res := icmd.RunCmd(run("helloworld", "--who", "Cleveland"))
res.Assert(t, icmd.Expected{
ExitCode: 0,
Out: "Hello Cleveland!",
})
}
12 changes: 0 additions & 12 deletions e2e/cli-plugins/run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,18 +144,6 @@ func TestRunGoodSubcommand(t *testing.T) {
})
}

// TestRunGoodArgument ensures correct behaviour when running a valid plugin with an `--argument`.
func TestRunGoodArgument(t *testing.T) {
run, _, cleanup := prepare(t)
defer cleanup()

res := icmd.RunCmd(run("helloworld", "--who", "Cleveland"))
res.Assert(t, icmd.Expected{
ExitCode: 0,
Out: "Hello Cleveland!",
})
}

// TestHelpGoodSubcommand ensures correct behaviour when invoking help on a
// valid plugin subcommand. A global argument is included to ensure it does not
// interfere.
Expand Down

0 comments on commit 60a4806

Please sign in to comment.