diff options
author | azul <azul@riseup.net> | 2016-10-17 08:58:08 +0000 |
---|---|---|
committer | azul <azul@riseup.net> | 2016-10-17 08:58:08 +0000 |
commit | 5dae257996c480c3f7b5a220fcaf97812a560466 (patch) | |
tree | 2edc9f7b40d7b04e4cf739e6e92b200f93cd57e7 /test/unit | |
parent | 6721f0732facd87404eecc288357fd1bd0de48cf (diff) | |
parent | 5967c4a568aff2c5e73e3ab933aa68d25387aeb1 (diff) |
Merge branch 'feature/log-requests-and-errors' into 'master'
Log requests and errors
proper logging
See merge request !6
Diffstat (limited to 'test/unit')
-rw-r--r-- | test/unit/logging_responder_test.rb | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/test/unit/logging_responder_test.rb b/test/unit/logging_responder_test.rb new file mode 100644 index 0000000..bb6c4a0 --- /dev/null +++ b/test/unit/logging_responder_test.rb @@ -0,0 +1,31 @@ +require 'test_helper' +require 'nickserver/logging_responder' + +module Nickserver + class LoggingResponderTest < Minitest::Test + + def test_responds_and_logs + logger.expect :info, nil, [" -> 200"] + respond_to 200, "body" + logger.verify + end + + protected + + def respond_to(*args) + responder.expect :respond, nil, args + logging_responder = LoggingResponder.new responder, logger + logging_responder.respond(*args) + responder.verify + end + + def responder + @responder ||= Minitest::Mock.new + end + + def logger + @logger ||= Minitest::Mock.new + end + + end +end |