提交 8968b98c 作者: Matt Bell

commands: Added tests for Request#SetOptions

上级 c19bdf18
......@@ -68,12 +68,26 @@ func TestOptionValidation(t *testing.T) {
t.Error("Should have passed")
}
req, _ = NewRequest(nil, nil, nil, nil, nil, opts)
req, _ = NewRequest(nil, nil, nil, nil, &cmd, opts)
req.SetOption("b", ":)")
res = cmd.Call(req)
if res.Error() == nil {
t.Error("Should have failed (string value not convertible to int)")
}
err := req.SetOptions(map[string]interface{}{
"b": 100,
})
if err != nil {
t.Error("Should have passed")
}
err = req.SetOptions(map[string]interface{}{
"b": ":)",
})
if err == nil {
t.Error("Should have failed (string value not convertible to int)")
}
}
func TestRegistration(t *testing.T) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论