Skip to content

Commit 78c2ecf

Browse files
authored
Merge pull request #88 from kaiwood/patch-1
Add standalone Minitest support to test runner
2 parents 414593f + 86fbf9f commit 78c2ecf

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)