Skip to content

Commit

Permalink
Merge pull request #88 from kaiwood/patch-1
Browse files Browse the repository at this point in the history
Add standalone Minitest support to test runner
  • Loading branch information
noniq authored Oct 30, 2019
2 parents 414593f + 86fbf9f commit 78c2ecf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Support/RubyMate/run_script.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
end

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

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

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

0 comments on commit 78c2ecf

Please sign in to comment.