forked from cloudfoundry/bosh-bootloader
-
Notifications
You must be signed in to change notification settings - Fork 2
/
up.go
64 lines (56 loc) · 1.36 KB
/
up.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
package fakes
import (
"github.com/cloudfoundry/bosh-bootloader/commands"
"github.com/cloudfoundry/bosh-bootloader/storage"
)
type Up struct {
CheckFastFailsCall struct {
CallCount int
Receives struct {
SubcommandFlags []string
State storage.State
}
Returns struct {
Error error
}
}
ParseArgsCall struct {
CallCount int
Receives struct {
Args []string
State storage.State
}
Returns struct {
Config commands.PlanConfig
Error error
}
}
ExecuteCall struct {
CallCount int
Receives struct {
Args []string
State storage.State
}
Returns struct {
Error error
}
}
}
func (u *Up) CheckFastFails(subcommandFlags []string, state storage.State) error {
u.CheckFastFailsCall.CallCount++
u.CheckFastFailsCall.Receives.SubcommandFlags = subcommandFlags
u.CheckFastFailsCall.Receives.State = state
return u.CheckFastFailsCall.Returns.Error
}
func (u *Up) ParseArgs(args []string, state storage.State) (commands.PlanConfig, error) {
u.ParseArgsCall.CallCount++
u.ParseArgsCall.Receives.Args = args
u.ParseArgsCall.Receives.State = state
return u.ParseArgsCall.Returns.Config, u.ParseArgsCall.Returns.Error
}
func (u *Up) Execute(args []string, state storage.State) error {
u.ExecuteCall.CallCount++
u.ExecuteCall.Receives.Args = args
u.ExecuteCall.Receives.State = state
return u.ExecuteCall.Returns.Error
}