Test Adapters: Always use the last output for score runs
* This prevents learners from cheating by printing the required status line themselves
This commit is contained in:
@ -9,11 +9,11 @@ class RScriptAdapter < TestingFrameworkAdapter
|
||||
end
|
||||
|
||||
def parse_output(output)
|
||||
captures = REGEXP.match(output[:stdout]).captures.map(&:to_i)
|
||||
captures = output[:stdout].scan(REGEXP).try(:last).map(&:to_i)
|
||||
count = captures.first
|
||||
passed = captures.second
|
||||
failed = count - passed
|
||||
assertion_error_matches = output[:stdout].scan(ASSERTION_ERROR_REGEXP).flatten || []
|
||||
{count: count, failed: failed, error_messages: assertion_error_matches}
|
||||
assertion_error_matches = output[:stdout].scan(ASSERTION_ERROR_REGEXP) || []
|
||||
{count: count, failed: failed, error_messages: assertion_error_matches.flatten.reject(&:blank?)}
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user