From 844ddfdd0da7f06edfda1fa960fd1609d1264565 Mon Sep 17 00:00:00 2001 From: usa Date: Tue, 8 May 2012 02:23:15 +0000 Subject: [PATCH] * test/minitest/metametameta.rb (MetaMetaMetaTestCase#assert_report): support drive letter on Windows. yes, the original code is metameta. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35587 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ test/minitest/metametameta.rb | 9 +++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 603101f60c..9b32bfddbf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue May 8 11:21:27 2012 NAKAMURA Usaku + + * test/minitest/metametameta.rb (MetaMetaMetaTestCase#assert_report): + support drive letter on Windows. yes, the original code is metameta. + Tue May 8 08:54:48 2012 Eric Hodel * lib/abbrev.rb: Fixed typo in abbrev pattern documentation. Based on diff --git a/test/minitest/metametameta.rb b/test/minitest/metametameta.rb index 4352cfee82..035ee77ab4 100644 --- a/test/minitest/metametameta.rb +++ b/test/minitest/metametameta.rb @@ -26,8 +26,13 @@ class MetaMetaMetaTestCase < MiniTest::Unit::TestCase output = @output.string.dup output.sub!(/Finished tests in .*/, "Finished tests in 0.00") output.sub!(/Loaded suite .*/, 'Loaded suite blah') - output.gsub!(/\[[^\]:]+:\d+\]/, '[FILE:LINE]') - output.gsub!(/^(\s+)[^:]+:\d+:in/, '\1FILE:LINE:in') + if /mswin|mingw/ =~ RUBY_PLATFORM + output.gsub!(/\[(?:[A-Za-z]:)?[^\]:]+:\d+\]/, '[FILE:LINE]') + output.gsub!(/^(\s+)(?:[A-Za-z]:)?[^:]+:\d+:in/, '\1FILE:LINE:in') + else + output.gsub!(/\[[^\]:]+:\d+\]/, '[FILE:LINE]') + output.gsub!(/^(\s+)[^:]+:\d+:in/, '\1FILE:LINE:in') + end assert_equal(expected, output) end