1
0
mirror of https://github.com/hybridgroup/gobot.git synced 2025-04-27 13:48:56 +08:00
hybridgroup.gobot/connection_test.go

37 lines
810 B
Go
Raw Normal View History

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))
})
})
})