Permalink
Browse files

Merge remote-tracking branch 'blt/is'

Conflicts:
	src/deputy.erl
  • Loading branch information...
bfrog committed Apr 16, 2012
2 parents 6534e2b + f7ef0b2 commit f066125f96c3ef046cd84c9a22ad1ff7391e78e5
Showing with 8 additions and 0 deletions.
  1. +8 −0 src/deputy.erl
View
@@ -198,6 +198,10 @@ check_rule(Value, {aint, Rule}) ->
ok ->
error
end;
+check_rule(Value, {is, Value}) ->
+ ok;
+check_rule(_Value, {is, _Other}) ->
+ error;
check_rule(Value, {convert, Type}) when is_atom(Type) ->
case convert(Value, Type) of
error ->
@@ -339,6 +343,10 @@ rule_regexp_test_() ->
rule_aint_test_() ->
[?_assertEqual(error, check_rule(<<"a">>, {aint, {in, [<<"a">>, <<"b">>]}}) ),
?_assertEqual(ok, check_rule(<<"b">>, {aint, {in, [<<"a">>, <<"c">>]}}) )
+
+rule_is_test_() ->
+ [?_assertEqual(error, check_rule(undefined, {is, verydefined}) ),
+ ?_assertEqual(ok, check_rule(undefined, {is, undefined}) )
].
rule_in_test_() ->

0 comments on commit f066125

Please sign in to comment.