]>
Commit | Line | Data |
---|---|---|
bae9f6d2 JC |
1 | package terraform |
2 | ||
15c0b25d AP |
3 | import "sync" |
4 | ||
bae9f6d2 JC |
5 | // MockUIOutput is an implementation of UIOutput that can be used for tests. |
6 | type MockUIOutput struct { | |
15c0b25d | 7 | sync.Mutex |
bae9f6d2 JC |
8 | OutputCalled bool |
9 | OutputMessage string | |
10 | OutputFn func(string) | |
11 | } | |
12 | ||
13 | func (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 | } |