test: multiple commands
This commit is contained in:
@@ -15,8 +15,8 @@ import (
|
||||
|
||||
type CommandExecutor interface {
|
||||
GenerateGame([]string) (uuid.UUID, error)
|
||||
Execute(cmd ...Command) error
|
||||
GameState() (rest.StateResponse, error)
|
||||
Execute(cmd ...Command) error
|
||||
}
|
||||
|
||||
type Command func(controller.Ctrl) error
|
||||
@@ -39,10 +39,10 @@ func NewDefaultConfigExecutor(configurer controller.Configurer) CommandExecutor
|
||||
return &executor{cfg: configurer}
|
||||
}
|
||||
|
||||
func (e *executor) Execute(cmd ...Command) error {
|
||||
func (e *executor) Execute(command ...Command) error {
|
||||
return controller.ExecuteCommand(e.cfg, func(c controller.Ctrl) error {
|
||||
for i := range cmd {
|
||||
if err := cmd[i](c); err != nil {
|
||||
for i := range command {
|
||||
if err := command[i](c); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user