mirror of
https://github.com/3bbbeau/tfvars-atlantis-config.git
synced 2024-11-22 14:00:52 +00:00
25 lines
424 B
Go
25 lines
424 B
Go
|
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)
|
||
|
}
|
||
|
}
|