github.com/segakazzz/buffalo@v0.16.22-0.20210119082501-1f52048d3feb/buffalo/cmd/version_test.go (about)

     1  package cmd
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/stretchr/testify/require"
     7  )
     8  
     9  func Test_VersionCmd(t *testing.T) {
    10  	r := require.New(t)
    11  
    12  	c := RootCmd
    13  	c.SetArgs([]string{
    14  		"version",
    15  	})
    16  	err := c.Execute()
    17  	r.NoError(err)
    18  }
    19  
    20  func Test_VersionJSONCmd(t *testing.T) {
    21  	r := require.New(t)
    22  
    23  	c := RootCmd
    24  	c.SetArgs([]string{
    25  		"version",
    26  		"--json",
    27  	})
    28  	err := c.Execute()
    29  	r.NoError(err)
    30  }