1
0
mirror of https://github.com/hybridgroup/gobot.git synced 2025-05-09 19:29:27 +08:00
hybridgroup.gobot/platforms/pebble/pebble_driver_test.go
2014-06-13 14:18:57 -07:00

31 lines
626 B
Go

package pebble
import (
"github.com/hybridgroup/gobot"
"testing"
)
var driver *PebbleDriver
func init() {
driver = NewPebbleDriver(NewPebbleAdaptor("adaptor"), "pebble")
}
func TestStart(t *testing.T) {
gobot.Expect(t, driver.Start(), true)
}
func TestHalt(t *testing.T) {
gobot.Expect(t, driver.Halt(), true)
}
func TestNotification(t *testing.T) {
driver.SendNotification("Hello")
driver.SendNotification("World")
gobot.Expect(t, driver.Messages[0], "Hello")
gobot.Expect(t, driver.PendingMessage(), "Hello")
gobot.Expect(t, driver.PendingMessage(), "World")
gobot.Expect(t, driver.PendingMessage(), "")
}