diff --git a/lib/junit_adapter.rb b/lib/junit_adapter.rb index 872e26dd..6a6061a0 100644 --- a/lib/junit_adapter.rb +++ b/lib/junit_adapter.rb @@ -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 diff --git a/lib/whistleblower.rb b/lib/whistleblower.rb index 7906a0b4..5d5102cf 100644 --- a/lib/whistleblower.rb +++ b/lib/whistleblower.rb @@ -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