1
0
mirror of https://github.com/hybridgroup/gobot.git synced 2025-05-01 13:48:57 +08:00
hybridgroup.gobot/platforms/pebble/pebble_driver_test.go

31 lines
626 B
Go
Raw Normal View History

2014-05-02 17:22:05 -05:00
package pebble
import (
2014-06-13 14:18:57 -07:00
"github.com/hybridgroup/gobot"
"testing"
2014-05-02 17:22:05 -05:00
)
2014-06-13 14:18:57 -07:00
var driver *PebbleDriver
2014-06-13 14:18:57 -07:00
func init() {
driver = NewPebbleDriver(NewPebbleAdaptor("adaptor"), "pebble")
}
2014-06-13 14:18:57 -07:00
func TestStart(t *testing.T) {
gobot.Expect(t, driver.Start(), true)
}
2014-06-13 14:18:57 -07:00
func TestHalt(t *testing.T) {
gobot.Expect(t, driver.Halt(), true)
}
2014-06-13 14:18:57 -07:00
func TestNotification(t *testing.T) {
driver.SendNotification("Hello")
driver.SendNotification("World")
2014-06-13 14:18:57 -07:00
gobot.Expect(t, driver.Messages[0], "Hello")
gobot.Expect(t, driver.PendingMessage(), "Hello")
gobot.Expect(t, driver.PendingMessage(), "World")
gobot.Expect(t, driver.PendingMessage(), "")
}