github.com/cloud-green/juju@v0.0.0-20151002100041-a00291338d3d/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 // Bring in the dummy provider definition. 12 _ "github.com/juju/juju/provider/dummy" 13 "github.com/juju/juju/testing" 14 ) 15 16 type MachineCommandSuite struct { 17 testing.BaseSuite 18 } 19 20 var _ = gc.Suite(&MachineCommandSuite{}) 21 22 var expectedCommmandNames = []string{ 23 "add", 24 "help", 25 "remove", 26 } 27 28 func (s *MachineCommandSuite) TestHelp(c *gc.C) { 29 // Check the help output 30 ctx, err := testing.RunCommand(c, machine.NewSuperCommand(), "--help") 31 c.Assert(err, jc.ErrorIsNil) 32 namesFound := testing.ExtractCommandsFromHelpOutput(ctx) 33 c.Assert(namesFound, gc.DeepEquals, expectedCommmandNames) 34 }