I have an application and I want to check if I have messages from my registrar correctly.
A brief example (you can switch between log4r and logger):
gem 'minitest' require 'minitest/autorun' require 'log4r'
But I get:
1) Failure: Testlog#test_output [minitest_log4r.rb:27]: In stdout. Expected: "INFO log: Hello World\n" Actual: ""
On my output screen, I see a message. I have similar results with Log4r::StderrOutputter and Log4r::Outputter.stdout .
So it seems that it is being sent to the output screen, but it is not caught by minitest in STDOUT or STDERR.
Before you start writing minitest-log4r-Gem:
Is it possible to test log output in minitest?
If not: Any recommendations for implementing a mini-log-log4r-gem?
Examples I could imagine:
- define a new output for minitest (Log4r :: MinitestOutputter)
- Wash the recorder.
- new statements (add new output as parameter?):
assert_message('INFO log: Hello World'){ @log.info("Hello World") }assert_messages(:info => 1, :debug => 2){ @log.info("Hello World") } for counting messages.assert_info_messages('Hello World'){ @log.info("Hello World") }assert_debug_messages('Hello World'){ @log.info("Hello World") }
source share