2013-05-22 19:46:23 -04:00
|
|
|
package packer
|
|
|
|
|
|
|
|
type TestBuilder struct {
|
|
|
|
prepareCalled bool
|
|
|
|
prepareConfig interface{}
|
|
|
|
runCalled bool
|
2013-06-10 01:00:47 -04:00
|
|
|
runCache Cache
|
2013-05-22 19:46:23 -04:00
|
|
|
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
|
|
|
|
}
|
|
|
|
|
2013-06-10 01:00:47 -04:00
|
|
|
func (tb *TestBuilder) Run(ui Ui, h Hook, c Cache) Artifact {
|
2013-05-22 19:46:23 -04:00
|
|
|
tb.runCalled = true
|
|
|
|
tb.runHook = h
|
|
|
|
tb.runUi = ui
|
2013-06-10 01:00:47 -04:00
|
|
|
tb.runCache = c
|
2013-05-22 19:46:23 -04:00
|
|
|
return nil
|
|
|
|
}
|
2013-06-03 17:44:34 -04:00
|
|
|
|
|
|
|
func (tb *TestBuilder) Cancel() {
|
|
|
|
tb.cancelCalled = true
|
|
|
|
}
|