hybridgroup.gobot/device_test.go

28 lines
559 B
Go
Raw Normal View History

2013-12-31 09:22:16 +08:00
package gobot
import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("Device", func() {
var (
someRobot Robot
)
BeforeEach(func() {
someRobot = Robot{
Connections: []Connection{newTestAdaptor("Connection 1")},
Devices: []Device{newTestDriver("Device 1")},
}
})
Context("when valid", func() {
It("Commands should return device commands", func() {
someRobot.initDevices()
Expect(someRobot.devices[0].Commands()).To(Equal([]string{"DriverCommand1", "DriverCommand2", "DriverCommand3"}))
})
})
})