tfvars-atlantis-config/cmd/version_test.go

25 lines
424 B
Go
Raw Normal View History

2024-02-26 12:44:50 +00:00
package cmd
import (
"bytes"
"testing"
)
// Tests the NewVersionCmd function returns the version of the utility.
func Test_NewVersionCmd(t *testing.T) {
t.Parallel()
got := new(bytes.Buffer)
cmd, _ := New()
cmd.SetArgs([]string{"version"})
cmd.SetOutput(got)
cmd.Execute() // nolint:errcheck
want := "devel\n"
if got.String() != want {
t.Errorf(`NewVersionCmd()
got %s
want %v`, got.String(), want)
}
}