blob: 5254e96723d14fb8c88d5b827896d8420b2ea6e1 [file] [log] [blame]
package tfexec
import (
"context"
"testing"
"github.com/hashicorp/terraform-exec/tfexec/internal/testutil"
)
func TestGetCmd(t *testing.T) {
td := testTempDir(t)
tf, err := NewTerraform(td, tfVersion(t, testutil.Latest012))
if err != nil {
t.Fatal(err)
}
// empty env, to avoid environ mismatch in testing
tf.SetEnv(map[string]string{})
t.Run("basic", func(t *testing.T) {
getCmd, err := tf.getCmd(context.Background())
if err != nil {
t.Fatal(err)
}
assertCmd(t, []string{
"get",
"-no-color",
"-update=false",
}, nil, getCmd)
})
}