Skip to content

Instantly share code, notes, and snippets.

@jeffersongirao
Created February 28, 2010 23:55
Show Gist options
  • Save jeffersongirao/317933 to your computer and use it in GitHub Desktop.
Save jeffersongirao/317933 to your computer and use it in GitHub Desktop.
<%
@selenium_opts = '-r features/support/selenium.rb'
@webrat_opts = '-r features/support/webrat.rb'
@rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : ""
def rerun?
!@rerun.to_s.strip.empty?
end
def target_opts
@rerun =~ /js_dependent/ ? @selenium_opts : @webrat_opts
end
rerun_opts = "#{@rerun} #{target_opts} --format pretty" if rerun?
include_opts = '-r features/step_definitions -r features/support/env.rb'
selenium_all_opts = '--format progress features/js_dependent' unless rerun?
webrat_all_opts = '--format progress features -e features/js_dependent' unless rerun?
std_opts = "#{rerun_opts} #{include_opts} --format rerun --out rerun.txt --strict --tags ~@wip"
wip_opts = "#{rerun_opts} #{include_opts} --tags @wip:3 --wip"
%>
default: <%= "#{std_opts} #{@webrat_opts} #{webrat_all_opts}" %>
wip: <%= "#{wip_opts} #{@webrat_opts} #{webrat_all_opts}" %>
selenium: <%= "#{std_opts} #{@selenium_opts} #{selenium_all_opts}" %>
selenium_wip: <%= "#{wip_opts} #{@selenium_opts} #{selenium_all_opts}" %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment