github.com/cloud-green/juju@v0.0.0-20151002100041-a00291338d3d/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 // Bring in the dummy provider definition. 12 _ "github.com/juju/juju/provider/dummy" 13 "github.com/juju/juju/testing" 14 ) 15 16 type SystemCommandSuite struct { 17 testing.BaseSuite 18 } 19 20 var _ = gc.Suite(&SystemCommandSuite{}) 21 22 var expectedCommmandNames = []string{ 23 "create-env", // alias for create-environment 24 "create-environment", 25 "destroy", 26 "environments", 27 "help", 28 "kill", 29 "list", 30 "list-blocks", 31 "login", 32 "remove-blocks", 33 "use-env", // alias for use-environment 34 "use-environment", 35 } 36 37 func (s *SystemCommandSuite) TestHelp(c *gc.C) { 38 // Check the help output 39 ctx, err := testing.RunCommand(c, system.NewSuperCommand(), "--help") 40 c.Assert(err, jc.ErrorIsNil) 41 namesFound := testing.ExtractCommandsFromHelpOutput(ctx) 42 c.Assert(namesFound, gc.DeepEquals, expectedCommmandNames) 43 }