github.com/mitchellh/packer@v1.3.2/builder/vmware/common/output_config_test.go (about)

     1  package common
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/hashicorp/packer/common"
     7  )
     8  
     9  func TestOutputConfigPrepare(t *testing.T) {
    10  	c := new(OutputConfig)
    11  	if c.OutputDir != "" {
    12  		t.Fatalf("what: %s", c.OutputDir)
    13  	}
    14  
    15  	pc := &common.PackerConfig{PackerBuildName: "foo"}
    16  	errs := c.Prepare(testConfigTemplate(t), pc)
    17  	if len(errs) > 0 {
    18  		t.Fatalf("err: %#v", errs)
    19  	}
    20  
    21  	if c.OutputDir == "" {
    22  		t.Fatal("should have output dir")
    23  	}
    24  }