Created
August 17, 2011 17:48
-
-
Save jdelStrother/1152129 to your computer and use it in GitHub Desktop.
Insert cucumber step names into rails' test.log
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
| class RailsLogInterpolator | |
| def before_step(step) | |
| @current_step = step | |
| Rails.logger.info("{{{ #{step.name}") | |
| end | |
| def before_step_result(keyword, step_match, multiline_arg, status, exception, source_indent, background) | |
| Rails.logger.info(" #{@current_step.name} }}}\n") | |
| end | |
| end | |
| class Cucumber::Cli::Configuration | |
| def formatters_with_log_interpolator(step_mother) | |
| formatters_without_log_interpolator(step_mother) << RailsLogInterpolator.new | |
| end | |
| alias_method_chain :formatters, :log_interpolator | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment