redding/sanford — pull request #123 by jcredding (2014-06-24 15:11:10+00:00)
Title: `TestRunner`, dependency inject attributes on service handler

This adds dependency injecting attributes on service handlers
with the `TestRunner`. This allows passing more than just params
when using the `test_runner` test helper. The `TestRunner` now
takes a hash of args and it will pull out keys for params, logger
and a request. Any other keys in the hash will be used to try and
write their values to the service handler it builds. This allows
dependency injecting values when a handler is built.

This also changes `Runner` to no longer have an `init` and `init!`
methods. These were originally done when `Runner` was a mixin that
could be used and configured on servers. This is no longer the case
and they were only used by the test runner so there's really no
need to keep these methods.

Finally, this moves the serializing of a response. It is now done
whenever the test runner builds a response, either from initing
or running the service handler, not just when its run. This makes
sure that when a handler halts in its `init!` or a callback, we
also try to serialize these responses to ensure they don't throw
any errors.

Finally, this adds unit tests for the test runner. Previously it
was only tested implicitly via the service handler.

Closes #106

@kellyredding - Ready for review.