Skip to content

Instantly share code, notes, and snippets.

@mattscilipoti
Created June 6, 2012 14:58
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattscilipoti/2882391 to your computer and use it in GitHub Desktop.
Save mattscilipoti/2882391 to your computer and use it in GitHub Desktop.
cucumber.yml that moves rerun.txt to tmp (DRYly)
<%
# vars for default formats. These are overridden by command line args.default_format_multi = "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'}"
default_format_single = "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'}"
html_report_options = " --format html --out='public/reports/features.html'"
# Use tmp dir for rerun.txt (vs. root)
rerun_file = File.join('tmp', 'rerun.txt')
rerun = File.file?(rerun_file) ? IO.read(rerun_file) : ""
rerun_format = "--format rerun --out #{ rerun_file }"
rerun_opts = rerun.to_s.strip.empty? ? "#{default_format_multi} features" : "#{default_format_single} #{rerun}"
std_opts = "#{default_format_multi} #{rerun_format} --strict --tags ~@wip --tags ~@demo"
%>
rerun: <%= rerun_opts %> <%= rerun_format %> --strict --tags ~@wip
default: <%= std_opts %> features
demo: --tags @demo features
wip: --tags @wip:3 --wip features
html_report: <%=default_format_multi %> <%=html_report_options %> features
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment