1
0
mirror of https://github.com/hybridgroup/gobot.git synced 2025-04-26 13:48:49 +08:00
hybridgroup.gobot/connection_test.go
2014-04-11 06:02:21 -07:00

37 lines
810 B
Go

package gobot
import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("Connection", func() {
var (
someRobot Robot
)
BeforeEach(func() {
someRobot = newTestRobot("")
start = func(r *Robot) {
r.startRobot()
}
someRobot.Start()
})
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))
})
})
})