commands: Fixed tests
Matt Bell committed
Nov 10, 2014 at 17:14 UTC
ce28fa363b7580ae28a7267dbd862f7b885a74a0
1 file changed
+5
-3
commands/command_test.go
+5
-3
@@ -2,13 +2,17 @@ package commands
2
3
import "testing"
4
5
+func noop(req Request) (interface{}, error) {
6
+ return nil, nil
7
+}
8
+
9
func TestOptionValidation(t *testing.T) {
10
cmd := Command{
11
Options: []Option{
12
Option{[]string{"b", "beep"}, Int, "enables beeper"},
13
Option{[]string{"B", "boop"}, String, "password for booper"},
14
},
11
- Run: func(res Response, req Request) {},
15
+ Run: noop,
16
}
17
18
req := NewEmptyRequest()
@@ -79,8 +83,6 @@ func TestOptionValidation(t *testing.T) {
83
}
84
85
func TestRegistration(t *testing.T) {
82
- noop := func(res Response, req Request) {}
83
-
86
cmdA := &Command{
87
Options: []Option{
88
Option{[]string{"beep"}, Int, "number of beeps"},