github.com/altoros/juju-vmware@v0.0.0-20150312064031-f19ae857ccca/cmd/juju/environment/environment_test.go (about)

     1  // Copyright 2014 Canonical Ltd.
     2  // Licensed under the AGPLv3, see LICENCE file for details.
     3  
     4  package environment_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/environment"
    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 EnvironmentCommandSuite struct {
    18  	testing.BaseSuite
    19  }
    20  
    21  var _ = gc.Suite(&EnvironmentCommandSuite{})
    22  
    23  var expectedCommmandNames = []string{
    24  	"ensure-availability",
    25  	"get",
    26  	"help",
    27  	"jenv",
    28  	"retry-provisioning",
    29  	"set",
    30  	"unset",
    31  }
    32  
    33  func (s *EnvironmentCommandSuite) TestHelp(c *gc.C) {
    34  	// Check the help output
    35  	ctx, err := testing.RunCommand(c, environment.NewSuperCommand(), "--help")
    36  	c.Assert(err, jc.ErrorIsNil)
    37  	namesFound := testing.ExtractCommandsFromHelpOutput(ctx)
    38  	c.Assert(namesFound, gc.DeepEquals, expectedCommmandNames)
    39  }