Green tests
This commit is contained in:
parent
189dddc3c0
commit
d1fc843838
6
api.go
6
api.go
|
@ -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
|
||||
|
|
|
@ -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"),
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue