github.com/mhilton/juju-juju@v0.0.0-20150901100907-a94dd2c73455/cmd/juju/system/system_test.go (about) 1 // Copyright 2015 Canonical Ltd. 2 // Licensed under the AGPLv3, see LICENCE file for details. 3 4 package system_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/system" 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 SystemCommandSuite struct { 18 testing.BaseSuite 19 } 20 21 var _ = gc.Suite(&SystemCommandSuite{}) 22 23 var expectedCommmandNames = []string{ 24 "create-env", // alias for create-environment 25 "create-environment", 26 "destroy", 27 "environments", 28 "help", 29 "kill", 30 "list", 31 "list-blocks", 32 "login", 33 "remove-blocks", 34 "use-env", // alias for use-environment 35 "use-environment", 36 } 37 38 func (s *SystemCommandSuite) TestHelp(c *gc.C) { 39 // Check the help output 40 ctx, err := testing.RunCommand(c, system.NewSuperCommand(), "--help") 41 c.Assert(err, jc.ErrorIsNil) 42 namesFound := testing.ExtractCommandsFromHelpOutput(ctx) 43 c.Assert(namesFound, gc.DeepEquals, expectedCommmandNames) 44 }