Fix pubsub mediator bug, add test spec.
Merge pull request #20 from cowboy129/master

Fix pubsub mediator bug, add test spec.