mirror of
https://github.com/hybridgroup/gobot.git
synced 2025-05-01 13:48:57 +08:00

Movinf events creation to newPebbleDriver method Adding basic button support Ignoring sass-cache and robeaux Adding accelerometer example Adding tap support Use custom server instead of classic martini This is to disable logs and avoid noise Adding correct format to code Adding notification support to pebble driver Adding tests and correcting PendingMessage Updating documentation Format to example accel Removing logging changes in api Removing temp fix in api, will be attended later Removing extra space
41 lines
881 B
Go
41 lines
881 B
Go
package pebble
|
|
|
|
import (
|
|
. "github.com/onsi/ginkgo"
|
|
. "github.com/onsi/gomega"
|
|
)
|
|
|
|
var _ = Describe("PebbleDriver", func() {
|
|
var (
|
|
driver *PebbleDriver
|
|
adaptor *PebbleAdaptor
|
|
)
|
|
|
|
BeforeEach(func() {
|
|
adaptor = NewPebbleAdaptor("pebble")
|
|
driver = NewPebbleDriver(adaptor, "pebble")
|
|
})
|
|
|
|
It("Must be able to Start", func() {
|
|
Expect(driver.Start()).To(Equal(true))
|
|
})
|
|
|
|
It("Must be able to Halt", func() {
|
|
Expect(driver.Halt()).To(Equal(true))
|
|
})
|
|
|
|
It("Adds message when sending notification", func() {
|
|
driver.SendNotification("Hello")
|
|
Expect(driver.Messages[0]).To(Equal("Hello"))
|
|
})
|
|
|
|
It("Retrieves pending messages", func() {
|
|
driver.SendNotification("Hello")
|
|
driver.SendNotification("World")
|
|
|
|
Expect(driver.PendingMessage()).To(Equal("Hello"))
|
|
Expect(driver.PendingMessage()).To(Equal("World"))
|
|
Expect(driver.PendingMessage()).To(Equal(""))
|
|
})
|
|
})
|