github.com/gobuffalo/buffalo-cli/v2@v2.0.0-alpha.15.0.20200919213536-a7350c8e6799/cli/buffalo_test.go (about)

     1  package cli
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/gobuffalo/plugins"
     7  	"github.com/stretchr/testify/require"
     8  )
     9  
    10  func Test_Buffalo_New(t *testing.T) {
    11  	r := require.New(t)
    12  
    13  	b, err := New()
    14  	r.NoError(err)
    15  	r.NotNil(b)
    16  	r.NotEmpty(b.Plugins)
    17  }
    18  
    19  func Test_Buffalo_SubCommands(t *testing.T) {
    20  	r := require.New(t)
    21  
    22  	c := &cp{}
    23  	b := &Buffalo{
    24  		Plugins: plugins.Plugins{
    25  			background("foo"),
    26  			c,
    27  		},
    28  	}
    29  	r.Len(b.Plugins, 2)
    30  
    31  	cmds := b.SubCommands()
    32  	r.Len(cmds, 1)
    33  	r.Equal(c, cmds[0])
    34  }