config: RawConfig.Config returns raw if no interpolate

This commit is contained in:
Mitchell Hashimoto 2014-06-12 17:47:05 -07:00
parent 8c50aa6382
commit 69841c22e6
2 changed files with 6 additions and 0 deletions

View File

@ -39,6 +39,7 @@ func NewRawConfig(raw map[string]interface{}) (*RawConfig, error) {
return &RawConfig{
Raw: raw,
Variables: walker.Variables,
config: raw,
}, nil
}

View File

@ -30,6 +30,11 @@ func TestRawConfig(t *testing.T) {
t.Fatalf("err: %s", err)
}
// Before interpolate, Config() should be the raw
if !reflect.DeepEqual(rc.Config(), raw) {
t.Fatalf("bad: %#v", rc.Config())
}
vars := map[string]string{"var.bar": "baz"}
if err := rc.Interpolate(vars); err != nil {
t.Fatalf("err: %s", err)