digispark: increase test coverage

Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
deadprogram 2017-04-06 09:55:04 +02:00
parent 7443293d2e
commit 06efa1855d
1 changed files with 8 additions and 0 deletions

View File

@ -2,6 +2,7 @@ package digispark
import ( import (
"errors" "errors"
"strings"
"testing" "testing"
"gobot.io/x/gobot" "gobot.io/x/gobot"
@ -70,6 +71,13 @@ func initTestAdaptor() *Adaptor {
return a return a
} }
func TestDigisparkAdaptorName(t *testing.T) {
a := NewAdaptor()
gobottest.Assert(t, strings.HasPrefix(a.Name(), "Digispark"), true)
a.SetName("NewName")
gobottest.Assert(t, a.Name(), "NewName")
}
func TestAdaptorConnect(t *testing.T) { func TestAdaptorConnect(t *testing.T) {
a := NewAdaptor() a := NewAdaptor()
gobottest.Assert(t, a.Connect(), ErrConnection) gobottest.Assert(t, a.Connect(), ErrConnection)