-
Notifications
You must be signed in to change notification settings - Fork 23
/
logger.go
33 lines (28 loc) · 954 Bytes
/
logger.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package fakes
type Logger struct {
PromptWithDetailsCall struct {
CallCount int
Receives struct {
ResourceType string
ResourceName string
}
ReturnsForCall []LoggerPromptWithDetailsCallReturn
Returns LoggerPromptWithDetailsCallReturn
}
}
type LoggerPromptWithDetailsCallReturn struct {
Bool bool
}
func (l *Logger) PromptWithDetails(resourceType, resourceName string) bool {
if len(l.PromptWithDetailsCall.ReturnsForCall) > 0 {
i := l.PromptWithDetailsCall.CallCount
l.PromptWithDetailsCall.CallCount++
l.PromptWithDetailsCall.Receives.ResourceType = resourceType
l.PromptWithDetailsCall.Receives.ResourceName = resourceName
return l.PromptWithDetailsCall.ReturnsForCall[i].Bool
}
return l.PromptWithDetailsCall.Returns.Bool
}
func (l *Logger) Printf(message string, a ...interface{}) {}
func (l *Logger) Println(message string) {}
func (l *Logger) NoConfirm() {}