Skip to content

Instantly share code, notes, and snippets.

@jdelStrother
Created August 17, 2011 17:48
Show Gist options
  • Select an option

  • Save jdelStrother/1152129 to your computer and use it in GitHub Desktop.

Select an option

Save jdelStrother/1152129 to your computer and use it in GitHub Desktop.
Insert cucumber step names into rails' test.log
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