github.com/cloud-green/juju@v0.0.0-20151002100041-a00291338d3d/cmd/juju/cachedimages/cachedimages_test.go (about)

     1  // Copyright 2015 Canonical Ltd.
     2  // Licensed under the AGPLv3, see LICENCE file for details.
     3  
     4  package cachedimages_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/cachedimages"
    11  	"github.com/juju/juju/testing"
    12  )
    13  
    14  type cachedImagesSuite struct {
    15  	testing.BaseSuite
    16  }
    17  
    18  var _ = gc.Suite(&cachedImagesSuite{})
    19  
    20  var expectedCachedImagesCommmandNames = []string{
    21  	"delete",
    22  	"help",
    23  	"list",
    24  }
    25  
    26  func (s *cachedImagesSuite) TestHelp(c *gc.C) {
    27  	// Check the help output
    28  	ctx, err := testing.RunCommand(c, cachedimages.NewSuperCommand(), "--help")
    29  	c.Assert(err, jc.ErrorIsNil)
    30  	namesFound := testing.ExtractCommandsFromHelpOutput(ctx)
    31  	c.Assert(namesFound, gc.DeepEquals, expectedCachedImagesCommmandNames)
    32  }