From 7c3d829070f8bf5090666aadd7a19fd3b2780b43 Mon Sep 17 00:00:00 2001 From: Mark VanderVoord Date: Wed, 18 May 2016 07:31:17 -0400 Subject: [PATCH] Protect against files without any test output --- auto/stylize_as_junit.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/auto/stylize_as_junit.rb b/auto/stylize_as_junit.rb index e52917e..27ac76d 100644 --- a/auto/stylize_as_junit.rb +++ b/auto/stylize_as_junit.rb @@ -97,7 +97,11 @@ class UnityToJUnit #use line[0] from the test output to get the test_file path and name test_file_str = lines[0].gsub("\\","/") test_file_str = test_file_str.split(":") - test_file = test_file_str[0] + ':' + test_file_str[1] + test_file = if (test_file_str.length < 2) + result_file + else + test_file_str[0] + ':' + test_file_str[1] + end result_output[:source][:path] = File.dirname(test_file) result_output[:source][:file] = File.basename(test_file)