Files
atlantis/server/help_executor_test.go
2017-09-17 18:06:52 -07:00

29 lines
696 B
Go

package server_test
import (
"log"
"os"
"testing"
"github.com/golang/mock/gomock"
"github.com/hootsuite/atlantis/github/mocks"
"github.com/hootsuite/atlantis/logging"
"github.com/hootsuite/atlantis/models"
"github.com/hootsuite/atlantis/server"
)
func TestExecute(t *testing.T) {
ctrl := gomock.NewController(t)
defer ctrl.Finish()
mock := mocks.NewMockClient(ctrl)
h := server.HelpExecutor{mock}
ctx := server.CommandContext{
BaseRepo: models.Repo{},
Pull: models.PullRequest{},
Log: logging.NewSimpleLogger("", log.New(os.Stderr, "", log.LstdFlags), false, logging.Debug),
}
mock.EXPECT().CreateComment(ctx.BaseRepo, ctx.Pull, gomock.Any())
h.Execute(&ctx)
}