config: test that LoadDir doesn't merge

This commit is contained in:
Mitchell Hashimoto 2014-07-19 16:44:23 -07:00
parent 69b7bc5047
commit cf1f3a9e73
4 changed files with 26 additions and 1 deletions

View File

@ -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
}

View File

@ -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)

View File

@ -0,0 +1,8 @@
variable "foo" {
default = "bar";
description = "bar";
}
resource "aws_instance" "db" {
security_groups = "${aws_security_group.firewall.*.id}"
}

View File

@ -0,0 +1,2 @@
resource "aws_instance" "db" {
}