improved readability

This commit is contained in:
Hauke Klement
2015-02-23 08:45:10 +01:00
parent 02904da7f9
commit 1268cdf7aa
2 changed files with 2 additions and 2 deletions

View File

@ -9,7 +9,7 @@ class JunitAdapter < TestingFrameworkAdapter
def parse_output(output)
if SUCCESS_REGEXP.match(output[:stdout])
{count: $1.to_i, passed: $1.to_i}
{count: Regexp.last_match(1).to_i, passed: Regexp.last_match(1).to_i}
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

View File

@ -10,7 +10,7 @@ class Whistleblower
def generate_hint(stderr)
if hint = find_hint(stderr)
hint.message.gsub(PLACEHOLDER_REGEXP) { @matches[$1.to_i] }
hint.message.gsub(PLACEHOLDER_REGEXP) { @matches[Regexp.last_match(1).to_i] }
end
end