packer-cn/builder/vmware/common/output_config_test.go

25 lines
427 B
Go
Raw Normal View History

2013-12-25 18:01:57 -05:00
package common
import (
"testing"
2017-04-04 16:39:01 -04:00
"github.com/hashicorp/packer/common"
2013-12-25 18:01:57 -05:00
)
func TestOutputConfigPrepare(t *testing.T) {
c := new(OutputConfig)
if c.OutputDir != "" {
t.Fatalf("what: %s", c.OutputDir)
}
pc := &common.PackerConfig{PackerBuildName: "foo"}
errs := c.Prepare(testConfigTemplate(t), pc)
if len(errs) > 0 {
t.Fatalf("err: %#v", errs)
}
if c.OutputDir == "" {
t.Fatal("should have output dir")
}
}