Skip to content

Instantly share code, notes, and snippets.

@jspillers
Created January 19, 2012 16:48
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 jspillers/1641113 to your computer and use it in GitHub Desktop.
Save jspillers/1641113 to your computer and use it in GitHub Desktop.
run specs multiple times with truncated output
#!/usr/bin/env ruby
ARGV[0].to_i.times do |i|
puts "run #{i+1}"
result = `rake SPEC=#{ARGV[1]}`
puts result.match(/(Finished in \d+.\d+ seconds)/)[1]
puts result.match(/(\d+ examples, \d+ failures?)/)[1]
if result.match(/Failed examples:/)
puts ''
puts 'Failed examples:'
puts result.split('Failed examples:').last
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment