github.com/mhilton/juju-juju@v0.0.0-20150901100907-a94dd2c73455/cmd/juju/service/service_test.go (about)

     1  // Copyright 2015 Canonical Ltd.
     2  // Licensed under the AGPLv3, see LICENCE file for details.
     3  
     4  package service_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/service"
    11  	// Bring in the dummy provider definition.
    12  	_ "github.com/juju/juju/provider/dummy"
    13  	"github.com/juju/juju/testing"
    14  )
    15  
    16  type ServiceCommandSuite struct {
    17  	testing.BaseSuite
    18  }
    19  
    20  var _ = gc.Suite(&ServiceCommandSuite{})
    21  
    22  var expectedCommmandNames = []string{
    23  	"add-unit",
    24  	"get",
    25  	"get-constraints",
    26  	"help",
    27  	"set",
    28  	"set-constraints",
    29  	"unset",
    30  }
    31  
    32  func (s *ServiceCommandSuite) TestHelp(c *gc.C) {
    33  	// Check the help output
    34  	ctx, err := testing.RunCommand(c, service.NewSuperCommand(), "--help")
    35  	c.Assert(err, jc.ErrorIsNil)
    36  	namesFound := testing.ExtractCommandsFromHelpOutput(ctx)
    37  	c.Assert(namesFound, gc.DeepEquals, expectedCommmandNames)
    38  }