From 8ea5300b5af805362778948cdf88cba34b49c115 Mon Sep 17 00:00:00 2001 From: Nathan LeClaire Date: Mon, 18 Jan 2016 14:30:11 -0800 Subject: [PATCH] Add test for 'docker-machine inspect' Signed-off-by: Nathan LeClaire --- commands/inspect_test.go | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 commands/inspect_test.go diff --git a/commands/inspect_test.go b/commands/inspect_test.go new file mode 100644 index 0000000000..779ce35d38 --- /dev/null +++ b/commands/inspect_test.go @@ -0,0 +1,31 @@ +package commands + +import ( + "testing" + + "github.com/docker/machine/commands/commandstest" + "github.com/docker/machine/libmachine" + "github.com/docker/machine/libmachine/libmachinetest" + "github.com/stretchr/testify/assert" +) + +func TestCmdInspect(t *testing.T) { + testCases := []struct { + commandLine CommandLine + api libmachine.API + expectedErr error + }{ + { + commandLine: &commandstest.FakeCommandLine{ + CliArgs: []string{"foo", "bar"}, + }, + api: &libmachinetest.FakeAPI{}, + expectedErr: ErrExpectedOneMachine, + }, + } + + for _, tc := range testCases { + err := cmdInspect(tc.commandLine, tc.api) + assert.Equal(t, tc.expectedErr, err) + } +}