From 41d1c14c6806d882910b0ef75380132477f2a9df Mon Sep 17 00:00:00 2001 From: "James O. D. Hunt" Date: Thu, 9 Aug 2018 14:17:54 +0100 Subject: [PATCH] tests: Move assert closer to function call Move a test assertion which seemed to have become separated from its correct location. Signed-off-by: James O. D. Hunt --- cli/events_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cli/events_test.go b/cli/events_test.go index 315b268606..2778164f51 100644 --- a/cli/events_test.go +++ b/cli/events_test.go @@ -23,11 +23,12 @@ func TestEventsCliAction(t *testing.T) { // get Action function actionFunc, ok := eventsCLICommand.Action.(func(ctx *cli.Context) error) + assert.True(ok) + flagSet := flag.NewFlagSet("events", flag.ContinueOnError) // create a new fake context ctx := cli.NewContext(&cli.App{}, flagSet, nil) - assert.True(ok) err := actionFunc(ctx) assert.Error(err, "Missing container ID")