commands: Fixed test
Matt Bell committed
Oct 27, 2014 at 14:47 UTC
b033e33293734c5239203d9f8daea88594b262ff
1 file changed
+8
-8
commands/command_test.go
+8
-8
@@ -12,16 +12,9 @@ func TestOptionValidation(t *testing.T) {
12
}
13
14
req := NewEmptyRequest()
15
- req.SetOption("foo", 5)
16
- res := cmd.Call(req)
17
- if res.Error() == nil {
18
- t.Error("Should have failed (unrecognized option)")
19
- }
20
-
21
- req = NewEmptyRequest()
15
req.SetOption("beep", 5)
16
req.SetOption("b", 10)
24
- res = cmd.Call(req)
17
+ res := cmd.Call(req)
18
if res.Error() == nil {
19
t.Error("Should have failed (duplicate options)")
20
}
@@ -56,6 +49,13 @@ func TestOptionValidation(t *testing.T) {
49
t.Error("Should have passed")
50
}
51
52
+ req = NewEmptyRequest()
53
+ req.SetOption("foo", 5)
54
+ res = cmd.Call(req)
55
+ if res.Error() != nil {
56
+ t.Error("Should have passed")
57
+ }
58
+
59
req = NewEmptyRequest()
60
req.SetOption(EncShort, "json")
61
res = cmd.Call(req)