2014-04-27 09:07:04 +08:00
|
|
|
package sphero
|
2014-04-26 18:11:51 +08:00
|
|
|
|
|
|
|
import (
|
2014-06-14 05:26:18 +08:00
|
|
|
"github.com/hybridgroup/gobot"
|
|
|
|
"testing"
|
2014-04-26 18:11:51 +08:00
|
|
|
)
|
|
|
|
|
2014-06-14 07:01:39 +08:00
|
|
|
func initTestSpheroAdaptor() *SpheroAdaptor {
|
|
|
|
a := NewSpheroAdaptor("bot", "/dev/null")
|
|
|
|
a.sp = gobot.NullReadWriteCloser{}
|
2014-11-20 08:17:14 +08:00
|
|
|
a.connect = func(a *SpheroAdaptor) (err error) { return nil }
|
2014-06-14 07:01:39 +08:00
|
|
|
return a
|
2014-06-14 05:26:18 +08:00
|
|
|
}
|
2014-04-26 18:11:51 +08:00
|
|
|
|
2014-06-14 07:01:39 +08:00
|
|
|
func TestSpheroAdaptorFinalize(t *testing.T) {
|
|
|
|
a := initTestSpheroAdaptor()
|
2014-11-20 15:21:19 +08:00
|
|
|
gobot.Assert(t, len(a.Finalize()), 0)
|
2014-06-14 05:26:18 +08:00
|
|
|
}
|
2014-06-14 07:01:39 +08:00
|
|
|
func TestSpheroAdaptorConnect(t *testing.T) {
|
|
|
|
a := initTestSpheroAdaptor()
|
2014-11-20 15:21:19 +08:00
|
|
|
gobot.Assert(t, len(a.Connect()), 0)
|
2014-06-14 05:26:18 +08:00
|
|
|
}
|