diff --git a/lib/junit_adapter.rb b/lib/junit_adapter.rb index 6a6061a0..87b70d84 100644 --- a/lib/junit_adapter.rb +++ b/lib/junit_adapter.rb @@ -2,6 +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(.*)/ def self.framework_name 'JUnit' @@ -13,7 +14,8 @@ class JunitAdapter < TestingFrameworkAdapter else count = COUNT_REGEXP.match(output[:stdout]).try(:captures).try(:first).try(:to_i) || 0 failed = FAILURES_REGEXP.match(output[:stdout]).try(:captures).try(:first).try(:to_i) || 0 - {count: count, failed: failed} + error_matches = ASSERTION_ERROR_REGEXP.match(output[:stdout]).try(:captures) || [] + {count: count, failed: failed, error_messages: error_matches} end end end