]> git.immae.eu Git - github/fretlink/terraform-provider-statuscake.git/blame - 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
CommitLineData
bae9f6d2
JC
1package terraform
2
15c0b25d
AP
3import "sync"
4
bae9f6d2
JC
5// MockUIOutput is an implementation of UIOutput that can be used for tests.
6type MockUIOutput struct {
15c0b25d 7 sync.Mutex
bae9f6d2
JC
8 OutputCalled bool
9 OutputMessage string
10 OutputFn func(string)
11}
12
13func (o *MockUIOutput) Output(v string) {
15c0b25d
AP
14 o.Lock()
15 defer o.Unlock()
bae9f6d2
JC
16 o.OutputCalled = true
17 o.OutputMessage = v
18 if o.OutputFn != nil {
19 o.OutputFn(v)
20 }
21}