github.com/altoros/juju-vmware@v0.0.0-20150312064031-f19ae857ccca/cmd/juju/machine/machine_test.go (about) 1 // Copyright 2014 Canonical Ltd. 2 // Licensed under the AGPLv3, see LICENCE file for details. 3 4 package machine_test 5 6 import ( 7 jc "github.com/juju/testing/checkers" 8 gc "gopkg.in/check.v1" 9 10 "github.com/juju/juju/cmd/juju/machine" 11 "github.com/juju/juju/testing" 12 13 // Bring in the dummy provider definition. 14 _ "github.com/juju/juju/provider/dummy" 15 ) 16 17 type MachineCommandSuite struct { 18 testing.BaseSuite 19 } 20 21 var _ = gc.Suite(&MachineCommandSuite{}) 22 23 var expectedCommmandNames = []string{ 24 "add", 25 "help", 26 "remove", 27 } 28 29 func (s *MachineCommandSuite) TestHelp(c *gc.C) { 30 // Check the help output 31 ctx, err := testing.RunCommand(c, machine.NewSuperCommand(), "--help") 32 c.Assert(err, jc.ErrorIsNil) 33 namesFound := testing.ExtractCommandsFromHelpOutput(ctx) 34 c.Assert(namesFound, gc.DeepEquals, expectedCommmandNames) 35 }