Fix unittest adapters
This commit is contained in:
@ -2,7 +2,7 @@ class JunitAdapter < TestingFrameworkAdapter
|
||||
COUNT_REGEXP = /Tests run: (\d+)/
|
||||
FAILURES_REGEXP = /Failures: (\d+)/
|
||||
SUCCESS_REGEXP = /OK \((\d+) test[s]?\)/
|
||||
ASSERTION_ERROR_REGEXP = /java\.lang\.AssertionError:\s(.*)/
|
||||
ASSERTION_ERROR_REGEXP = /java\.lang\.AssertionError:\s(.*)|org\.junit\.ComparisonFailure:\s(.*)/
|
||||
|
||||
def self.framework_name
|
||||
'JUnit'
|
||||
|
@ -11,7 +11,7 @@ class PyUnitAdapter < TestingFrameworkAdapter
|
||||
count = COUNT_REGEXP.match(output[:stderr]).captures.first.to_i
|
||||
matches = FAILURES_REGEXP.match(output[:stderr])
|
||||
failed = matches ? matches.captures.try(:first).to_i : 0
|
||||
error_matches = ASSERTION_ERROR_REGEXP.match(output[:stderr]).captures
|
||||
error_matches = ASSERTION_ERROR_REGEXP.match(output[:stderr]).try(:captures) || []
|
||||
{count: count, failed: failed, error_messages: error_matches}
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user