Permalink
Browse files

Added parsing test for message acking

  • Loading branch information...
1 parent 54cdf0d commit 48e77528bd880018a468bce27ff69b1e8e376952 Gianfranco Alongi committed Mar 25, 2012
View
1 Three/Solution/src/message.hrl
@@ -3,3 +3,4 @@
byte_size :: non_neg_integer()
}).
-record(pipe_declaration,{type :: publish | subscribe}).
+-record(message_ack,{id :: string()}).
View
5 Three/Solution/src/pubsub_parser.erl
@@ -6,5 +6,8 @@
parse("publish-connection") ->
#pipe_declaration{type = publish};
parse("subscribe-connection") ->
- #pipe_declaration{type = subscribe}.
+ #pipe_declaration{type = subscribe};
+parse("ack "++ID) ->
+ #message_ack{id = ID}.
+
View
5 Three/Solution/test/pubsub_parser_tests.erl
@@ -12,6 +12,9 @@ parse_subscribe_selector_test() ->
Res = pubsub_parser:parse(Message),
?assertMatch(#pipe_declaration{type = subscribe},Res).
-
+parse_ack_message_test() ->
+ Message = "ack MSG_ID",
+ Res = pubsub_parser:parse(Message),
+ ?assertMatch(#message_ack{id = "MSG_ID"},Res).

0 comments on commit 48e7752

Please sign in to comment.