2013-12-31 13:29:01 -08:00
|
|
|
package gobot
|
|
|
|
|
|
|
|
import (
|
|
|
|
. "github.com/onsi/ginkgo"
|
|
|
|
. "github.com/onsi/gomega"
|
|
|
|
)
|
|
|
|
|
|
|
|
var _ = Describe("Connection", func() {
|
|
|
|
|
|
|
|
var (
|
|
|
|
someRobot Robot
|
|
|
|
)
|
|
|
|
|
|
|
|
BeforeEach(func() {
|
|
|
|
someRobot = newTestRobot("")
|
2014-04-11 06:02:21 -07:00
|
|
|
start = func(r *Robot) {
|
|
|
|
r.startRobot()
|
|
|
|
}
|
|
|
|
someRobot.Start()
|
2013-12-31 13:29:01 -08:00
|
|
|
})
|
|
|
|
|
|
|
|
Context("when valid", func() {
|
|
|
|
It("Connect should call adaptor Connect", func() {
|
|
|
|
Expect(someRobot.Connections[0].Connect()).To(Equal(true))
|
|
|
|
})
|
|
|
|
It("Finalize should call adaptor Finalize", func() {
|
|
|
|
Expect(someRobot.Connections[0].Connect()).To(Equal(true))
|
|
|
|
})
|
|
|
|
It("Disconnect should call adaptor Disconnect", func() {
|
|
|
|
Expect(someRobot.Connections[0].Connect()).To(Equal(true))
|
|
|
|
})
|
|
|
|
It("Reconnect should call adaptor Reconnect", func() {
|
|
|
|
Expect(someRobot.Connections[0].Connect()).To(Equal(true))
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|