Commit 8a78d4d8 authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

packer/rpc: Test Builder.Run

parent c537c304
......@@ -48,6 +48,21 @@ func TestBuilderRPC(t *testing.T) {
bClient.Prepare(config)
assert.True(b.prepareCalled, "prepare should be called")
assert.Equal(b.prepareConfig, 42, "prepare should be called with right arg")
// Test Run
build := &testBuild{}
ui := &testUi{}
bClient.Run(build, ui)
assert.True(b.runCalled, "runs hould be called")
if b.runCalled {
b.runBuild.Prepare()
assert.True(build.prepareCalled, "prepare should be called")
b.runUi.Say("format")
assert.True(ui.sayCalled, "say should be called")
assert.Equal(ui.sayFormat, "format", "format should be correct")
}
}
func TestBuilder_ImplementsBuild(t *testing.T) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment