Advertisement
saasbook

autograder example

Jan 22nd, 2012
6,539
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.29 KB | None | 0 0
  1. def parse_stats
  2.   regex = /(\d+)\s+examples?,\s+(\d+)\s+failures?(,\s+(\d+)\s+pending)?$/
  3.   if @output =~ regex
  4.     @total, @failed, @pending = $1.to_i, $2.to_i, $4.to_i
  5.     @passed = @total - @failed - @pending
  6.   else
  7.     @output << "\nCan't parse output: #{@output_stream}"
  8.   end
  9. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement