]> git.immae.eu Git - github/fretlink/terraform-provider-statuscake.git/blob - vendor/github.com/hashicorp/terraform/terraform/ui_output_mock.go
Merge branch 'fix_read_test' of github.com:alexandreFre/terraform-provider-statuscake
[github/fretlink/terraform-provider-statuscake.git] / vendor / github.com / hashicorp / terraform / terraform / ui_output_mock.go
1 package terraform
2
3 import "sync"
4
5 // MockUIOutput is an implementation of UIOutput that can be used for tests.
6 type MockUIOutput struct {
7 sync.Mutex
8 OutputCalled bool
9 OutputMessage string
10 OutputFn func(string)
11 }
12
13 func (o *MockUIOutput) Output(v string) {
14 o.Lock()
15 defer o.Unlock()
16 o.OutputCalled = true
17 o.OutputMessage = v
18 if o.OutputFn != nil {
19 o.OutputFn(v)
20 }
21 }