Created
March 3, 2016 18:50
-
-
Save mreinsch/2c8dbb01e51c32c3c5c8 to your computer and use it in GitHub Desktop.
log details on test runs to log to make it easier to understand what is going on
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module RSpecLoggerListener | |
extend self | |
def start(notification) | |
Rails.logger.info("\n\n====== Starting new test run") | |
end | |
def stop(notification) | |
Rails.logger.info("\n\n====== Test run finished") | |
end | |
def example_started(notification) | |
Rails.logger.info("\n\n====== START #{notification.example.full_description}") | |
end | |
def example_passed(notification) | |
Rails.logger.info("====== PASSED #{notification.example.full_description}") | |
end | |
def example_failed(notification) | |
Rails.logger.info("====== FAILED #{notification.example.full_description}") | |
end | |
def example_pending(notification) | |
Rails.logger.info("====== PENDING #{notification.example.full_description}") | |
end | |
end | |
RSpec.configuration.reporter.register_listener(RSpecLoggerListener, | |
:start, :stop, :example_started, :example_passed, | |
:example_failed, :example_pending) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment