mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
Add test case for autoloading tfvars
This commit is contained in:
parent
e67ecb5ce2
commit
4bf2269784
@ -363,6 +363,15 @@ func TestMeta_process(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatalf("err: %s", err)
|
||||
}
|
||||
// Regular tfvars files will not be autoloaded
|
||||
fileIgnored := "ignored.tfvars"
|
||||
err = ioutil.WriteFile(
|
||||
filepath.Join(d, fileIgnored),
|
||||
[]byte(""),
|
||||
0644)
|
||||
if err != nil {
|
||||
t.Fatalf("err: %s", err)
|
||||
}
|
||||
|
||||
m := new(Meta)
|
||||
args := []string{}
|
||||
@ -371,6 +380,10 @@ func TestMeta_process(t *testing.T) {
|
||||
t.Fatalf("err: %s", err)
|
||||
}
|
||||
|
||||
if len(args) != 6 {
|
||||
t.Fatalf("expected 6 args, got %v", args)
|
||||
}
|
||||
|
||||
if args[0] != "-var-file-default" {
|
||||
t.Fatalf("expected %q, got %q", "-var-file-default", args[0])
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user