1
0
mirror of https://github.com/hybridgroup/gobot.git synced 2025-04-24 13:48:49 +08:00
hybridgroup.gobot/commander_test.go
deadprogram 953c3254e7 core: use canonical import domain of gobot.io for all code
Signed-off-by: deadprogram <ron@hybridgroup.com>
2016-12-08 13:24:03 +01:00

25 lines
488 B
Go

package gobot
import (
"testing"
"gobot.io/x/gobot/gobottest"
)
func TestCommaner(t *testing.T) {
c := NewCommander()
c.AddCommand("test", func(map[string]interface{}) interface{} {
return "hi"
})
if _, ok := c.Commands()["test"]; !ok {
t.Errorf("Could not add command to list of Commands")
}
command := c.Command("test")
gobottest.Refute(t, command, nil)
command = c.Command("booyeah")
gobottest.Assert(t, command, (func(map[string]interface{}) interface{})(nil))
}