config: test that LoadDir doesn't merge
This commit is contained in:
parent
69b7bc5047
commit
cf1f3a9e73
|
@ -50,7 +50,7 @@ func LoadDir(path string) (*Config, error) {
|
|||
}
|
||||
|
||||
if result != nil {
|
||||
result, err = Merge(result, c)
|
||||
result, err = Append(result, c)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
@ -156,6 +156,21 @@ func TestLoadDir_noConfigs(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestLoadDir_noMerge(t *testing.T) {
|
||||
c, err := LoadDir(filepath.Join(fixtureDir, "dir-merge"))
|
||||
if err != nil {
|
||||
t.Fatalf("err: %s", err)
|
||||
}
|
||||
|
||||
if c == nil {
|
||||
t.Fatal("config should not be nil")
|
||||
}
|
||||
|
||||
if err := c.Validate(); err == nil {
|
||||
t.Fatal("should not be valid")
|
||||
}
|
||||
}
|
||||
|
||||
func outputsStr(os []*Output) string {
|
||||
ns := make([]string, 0, len(os))
|
||||
m := make(map[string]*Output)
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
variable "foo" {
|
||||
default = "bar";
|
||||
description = "bar";
|
||||
}
|
||||
|
||||
resource "aws_instance" "db" {
|
||||
security_groups = "${aws_security_group.firewall.*.id}"
|
||||
}
|
|
@ -0,0 +1,2 @@
|
|||
resource "aws_instance" "db" {
|
||||
}
|
Loading…
Reference in New Issue