Skip to content

Instantly share code, notes, and snippets.

@richdownie
Created April 11, 2017 22:46
Show Gist options
  • Save richdownie/5228ee508600dca5d140f7e0591dc8d0 to your computer and use it in GitHub Desktop.
Save richdownie/5228ee508600dca5d140f7e0591dc8d0 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|
puts console_output = pipe.read
pipe.close_write
end
IO.popen("cucumber #{args[:tag]}.txt --format html --out=#{file}.html --format pretty", 'r+') do |pipe|
puts "** RE-RUNNING FAILED #{args[:tags]}.txt 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