constellation/cli/cmd/version_test.go
2022-04-21 09:06:35 +02:00

26 lines
415 B
Go

package cmd
import (
"bytes"
"io"
"testing"
"github.com/edgelesssys/constellation/internal/constants"
"github.com/stretchr/testify/assert"
)
func TestVersionCmd(t *testing.T) {
assert := assert.New(t)
cmd := newVersionCmd()
b := &bytes.Buffer{}
cmd.SetOut(b)
err := cmd.Execute()
assert.NoError(err)
s, err := io.ReadAll(b)
assert.NoError(err)
assert.Contains(string(s), constants.CliVersion)
}