keyboard: increase test coverage

Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
deadprogram 2017-04-06 10:49:34 +02:00
parent 39bf7540df
commit 628a087a0f
1 changed files with 8 additions and 0 deletions

View File

@ -2,6 +2,7 @@ package keyboard
import (
"os"
"strings"
"testing"
"gobot.io/x/gobot"
@ -25,6 +26,13 @@ func TestKeyboardDriver(t *testing.T) {
gobottest.Assert(t, d.Connection(), (gobot.Connection)(nil))
}
func TestKeyboardDriverName(t *testing.T) {
d := initTestKeyboardDriver()
gobottest.Assert(t, strings.HasPrefix(d.Name(), "Keyboard"), true)
d.SetName("NewName")
gobottest.Assert(t, d.Name(), "NewName")
}
func TestKeyboardDriverStart(t *testing.T) {
d := initTestKeyboardDriver()
gobottest.Assert(t, d.Start(), nil)