Skip to content

Instantly share code, notes, and snippets.

@richdownie
Created April 11, 2017 23:12
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 richdownie/6e5d78d9eded4adaf423312b1e98f59e to your computer and use it in GitHub Desktop.
Save richdownie/6e5d78d9eded4adaf423312b1e98f59e to your computer and use it in GitHub Desktop.
require 'bundler'
namespace :cuke do
desc "run cuke builds by cuke tag"
task :hub, [:tag] do |t, args|
file = "#{args[:tag]}".gsub(/@/, '')
Bundler.with_clean_env do
console_output = ""
IO.popen("cucumber -t #{args[:tag]} -f rerun --out #{file}.txt", 'r+') do |pipe|
console_output = pipe.read
pipe.close_write
end
IO.popen("cucumber #{args[:tag]}.txt", 'r+') do |pipe|
puts "** RE-RUNNING FAILED SCENARIOS **"
puts console_output = pipe.read
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment