blob: 79fd4b5b06b9614385e0adff9661d14ba0af1b21 [file]
package tfexec
import (
"context"
"os"
"testing"
"github.com/hashicorp/terraform-exec/tfexec/internal/testutil"
)
func TestShowCmd(t *testing.T) {
td := testTempDir(t)
defer os.RemoveAll(td)
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{})
// defaults
showCmd := tf.showCmd(context.Background())
assertCmd(t, []string{
"show",
"-json",
"-no-color",
}, nil, showCmd)
}