github.com/tomaszheflik/terraform@v0.7.3-0.20160827060421-32f990b41594/terraform/ui_output_provisioner_test.go (about) 1 package terraform 2 3 import ( 4 "testing" 5 ) 6 7 func TestProvisionerUIOutput_impl(t *testing.T) { 8 var _ UIOutput = new(ProvisionerUIOutput) 9 } 10 11 func TestProvisionerUIOutputOutput(t *testing.T) { 12 hook := new(MockHook) 13 output := &ProvisionerUIOutput{ 14 Info: nil, 15 Type: "foo", 16 Hooks: []Hook{hook}, 17 } 18 19 output.Output("bar") 20 21 if !hook.ProvisionOutputCalled { 22 t.Fatal("should be called") 23 } 24 if hook.ProvisionOutputProvisionerId != "foo" { 25 t.Fatalf("bad: %#v", hook.ProvisionOutputProvisionerId) 26 } 27 if hook.ProvisionOutputMessage != "bar" { 28 t.Fatalf("bad: %#v", hook.ProvisionOutputMessage) 29 } 30 }