Browse files

Merge pull request #4319 from castlerock/parse_only_minitest_results

parse only minitest results in isolation test
  • Loading branch information...
2 parents dcd317b + c776075 commit 377a879e12259f30566eb4a8007c924c27f04d8a @spastorino spastorino committed Jan 5, 2012
Showing with 1 addition and 21 deletions.
  1. +1 −21 activesupport/test/isolation_test.rb
View
22 activesupport/test/isolation_test.rb
@@ -80,26 +80,6 @@ class ParentIsolationTest < ActiveSupport::TestCase
ENV.delete("CHILD")
def setup
- defined?(::MiniTest) ? parse_minitest : parse_testunit
- end
-
- def parse_testunit
- @results = {}
- OUTPUT[/Started\n\s*(.*)\s*\nFinished/mi, 1].to_s.split(/\s*\n\s*/).each do |result|
- result =~ %r'^(\w+)\(\w+\):\s*(\.|E|F)$'
- @results[$1] = { 'E' => :error, '.' => :success, 'F' => :failure }[$2]
- end
-
- # Extract the backtraces
- @backtraces = {}
- OUTPUT.scan(/^\s*\d+\).*?\n\n/m).each do |backtrace|
- # \n 1) Error:\ntest_captures_errors(ChildIsolationTest):
- backtrace =~ %r'\s*\d+\)\s*(Error|Failure):\n(\w+)'i
- @backtraces[$2] = { :type => $1, :output => backtrace }
- end
- end
-
- def parse_minitest
@results = {}
OUTPUT[/Started\n\s*(.*)\s*\nFinished/mi, 1].to_s.split(/\s*\n\s*/).each do |result|
result =~ %r'^\w+#(\w+):.*:\s*(.*Assertion.*|.*RuntimeError.*|\.\s*)$'
@@ -115,7 +95,7 @@ def parse_minitest
OUTPUT.scan(/^\s*\d+\).*?\n\n/m).each do |backtrace|
# \n 1) Error:\ntest_captures_errors(ChildIsolationTest):
backtrace =~ %r'\s*\d+\)\s*(Error|Failure):\n(\w+)'i
- @backtraces[$2] = { :type => $1, :output => backtrace }
+ @backtraces[$2] = {:type => $1, :output => backtrace}
end
end

0 comments on commit 377a879

Please sign in to comment.