FilterStringArgs tests

This commit is contained in:
Taylor Gerring
2015-03-26 20:04:03 +01:00
parent e21ce9a9b4
commit 62ebf999bf
3 changed files with 35 additions and 18 deletions

View File

@ -649,18 +649,13 @@ func (args *FilterStringArgs) UnmarshalJSON(b []byte) (err error) {
if !ok {
return NewInvalidTypeError("filter", "not a string")
}
args.Word = argstr
return nil
}
func (args *FilterStringArgs) requirements() error {
switch args.Word {
switch argstr {
case "latest", "pending":
break
default:
return NewValidationError("Word", "Must be `latest` or `pending`")
}
args.Word = argstr
return nil
}