Skip to content

Commit

Permalink
Green tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zankich committed Apr 18, 2014
1 parent 189dddc commit d1fc843
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
6 changes: 5 additions & 1 deletion api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"),
Expand Down
1 change: 1 addition & 0 deletions master_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit d1fc843

Please sign in to comment.