Add test for 'docker-machine inspect'

Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
This commit is contained in:
Nathan LeClaire 2016-01-18 14:30:11 -08:00
parent d6e7d5b966
commit 8ea5300b5a
1 changed files with 31 additions and 0 deletions

31
commands/inspect_test.go Normal file
View File

@ -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)
}
}