2013-05-22 19:46:23 -04:00
|
|
|
package packer
|
|
|
|
|
|
|
|
type TestBuilder struct {
|
|
|
|
prepareCalled bool
|
|
|
|
prepareConfig interface{}
|
|
|
|
runCalled bool
|
|
|
|
runHook Hook
|
|
|
|
runUi Ui
|
2013-06-03 17:44:34 -04:00
|
|
|
cancelCalled bool
|
2013-05-22 19:46:23 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
func (tb *TestBuilder) Prepare(config interface{}) error {
|
|
|
|
tb.prepareCalled = true
|
|
|
|
tb.prepareConfig = config
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (tb *TestBuilder) Run(ui Ui, h Hook) Artifact {
|
|
|
|
tb.runCalled = true
|
|
|
|
tb.runHook = h
|
|
|
|
tb.runUi = ui
|
|
|
|
return nil
|
|
|
|
}
|
2013-06-03 17:44:34 -04:00
|
|
|
|
|
|
|
func (tb *TestBuilder) Cancel() {
|
|
|
|
tb.cancelCalled = true
|
|
|
|
}
|