Created
September 4, 2015 21:07
-
-
Save jhawthorn/2910761cd64fcc9d8bd8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
class Example | |
attr_reader :spec_name, :status | |
def initialize(example_id, status, run_time, _) | |
@example_id = example_id | |
@status = status | |
@run_time = run_time | |
end | |
end | |
all_examples = ARGV.flat_map do |example_file| | |
lines = File.read(example_file).lines | |
lines.shift(2) | |
lines.map do |line| | |
Example.new(*line.split(/\s+\|\s+?/, -1)) | |
end | |
end | |
counts = Hash.new(0) | |
total_count = 0 | |
all_examples.each do |example| | |
counts[example.status] += 1 | |
total_count += 1 | |
end | |
out = "#{total_count} examples, #{counts['failed']} failures" | |
out << ", #{counts['pending']} pending" if counts.has_key?('pending') | |
puts out | |
exit counts['failed'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage: