Green tests

This commit is contained in:
Adrian Zankich 2014-04-18 14:45:50 -07:00
parent 189dddc3c0
commit d1fc843838
3 changed files with 8 additions and 4 deletions

6
api.go
View File

@ -33,10 +33,14 @@ type jsonConnection struct {
Adaptor string `json:"adaptor"`
}
func (me *api) StartApi() {
var startApi = func(me *api) {
go me.server.Run()
}
func (me *api) StartApi() {
startApi(me)
}
func Api(bot *Master) *api {
a := new(api)
a.master = bot

View File

@ -3,7 +3,6 @@ package gobot
import (
"bytes"
"encoding/json"
//"github.com/go-martini/martini"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"io/ioutil"
@ -19,8 +18,8 @@ var _ = Describe("Master", func() {
)
BeforeEach(func() {
myMaster = GobotMaster()
//startApi = func(m *martini.ClassicMartini) {}
myMaster = GobotMaster()
startApi = func(m *api) {}
a = Api(myMaster)
myMaster.Robots = []*Robot{
newTestRobot("Robot 1"),

View File

@ -18,6 +18,7 @@ var _ = Describe("Master", func() {
newTestRobot("Robot 2"),
newTestRobot("Robot 3"),
}
startApi = func(m *api) {}
trap = func(c chan os.Signal) {
c <- os.Interrupt
}