blob: 4bb6ff2a847be174d64ce025865a4eb4350ec7d2 [file] [log] [blame]
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
package tfexec
import (
"context"
"testing"
"github.com/hashicorp/terraform-exec/tfexec/internal/testutil"
)
func TestGetCmd(t *testing.T) {
td := t.TempDir()
tf, err := NewTerraform(td, tfVersion(t, testutil.Latest_v1))
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)
})
}