mirror of
https://github.com/hybridgroup/gobot.git
synced 2025-04-27 13:48:56 +08:00
34 lines
766 B
Go
34 lines
766 B
Go
![]() |
package gobot
|
||
|
|
||
|
import (
|
||
|
. "github.com/onsi/ginkgo"
|
||
|
. "github.com/onsi/gomega"
|
||
|
)
|
||
|
|
||
|
var _ = Describe("Connection", func() {
|
||
|
|
||
|
var (
|
||
|
someRobot Robot
|
||
|
)
|
||
|
|
||
|
BeforeEach(func() {
|
||
|
someRobot = newTestRobot("")
|
||
|
someRobot.startRobot()
|
||
|
})
|
||
|
|
||
|
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))
|
||
|
})
|
||
|
})
|
||
|
})
|