Skip to content

Instantly share code, notes, and snippets.

@nevans
Created October 2, 2009 15:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nevans/199825 to your computer and use it in GitHub Desktop.
Save nevans/199825 to your computer and use it in GitHub Desktop.
cucumber RailsLoggerFormatter
Works with cucumber 0.3.104. Earlier versions of
cucumber use a slightly different formatter API,
and will require small tweaks to make this work.
default: -r features -f RailsLoggerFormatter
require 'cucumber/formatter/pretty'
class RailsLoggerFormatter < Cucumber::Formatter::Pretty
def before_feature(feature)
Rails.logger.info "****** Feature ***********************************"
Rails.logger.info feature.name.map{|l|"** "+l}.join
super
end
def scenario_name(keyword, name, file_colon_line, source_indent)
Rails.logger.info "****** Scenario **********************************"
Rails.logger.info name.map{|l|"**** "+l}.join
super
end
def before_step(step)
Rails.logger.info "****** Step: #{step.name}"
super
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment