Skip to content

Commit 86fbf9f

Browse files
author
Kai Wood
committed
Add standalone Minitest support to test runner
Before this change, the test runner didn't detect minitest/autorun, the standard test framework nowadays. This adds working colorization and clickable file links.
1 parent 97608b6 commit 86fbf9f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Support/RubyMate/run_script.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
end
4242

4343
is_test_script = !(ENV["TM_FILEPATH"].match(/(?:\b|_)(?:tc|ts|test)(?:\b|_)/).nil? and
44-
File.read(ENV["TM_FILEPATH"]).match(/\brequire\b.+(?:test\/unit|test_helper)/).nil?)
44+
File.read(ENV["TM_FILEPATH"]).match(/\brequire\b.+(?:test\/unit|test_helper|minitest)/).nil?)
4545

4646
cmd = [ENV['TM_RUBY'] || 'ruby', '-rcatch_exception']
4747

@@ -132,8 +132,8 @@ def actual_path_name(path)
132132
elsif line =~ /([\w\_]+).*\[([\w\_\/\.]+)\:(\d+)\]/ # whatever_message....[function_name/.whatever:line_no]
133133
method, file, line = $1, $2, $3
134134
"<span><a href=\"txmt://open?#{path_to_url_chunk(file)}line=#{line}\">#{method}</a></span>:#{line}<br/>"
135-
elsif line =~ /^\d+ tests, \d+ assertions, (\d+) failures, (\d+) errors\b.*/
136-
"<div class=\"test #{$1 + $2 == "00" ? "ok" : "fail"}\">#{$&}</div>\n"
135+
elsif line =~ /^\d+ (tests|runs), \d+ assertions, (\d+) failures, (\d+) errors\b.*/
136+
"<div class=\"test #{$2 + $3 == "00" ? "ok" : "fail"}\">#{$&}</div>\n"
137137
end
138138
end
139139
end

0 commit comments

Comments
 (0)