Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions lib/guard/minitest/runner.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
require 'guard/minitest/inspector'
require 'English'
require 'open3'

module Guard
class Minitest < Plugin
Expand Down Expand Up @@ -40,7 +41,7 @@ def run(paths, options = {})

begin
status = _run_possibly_bundled_command(paths, options[:all])
rescue Errno::ENOENT => e
rescue RuntimeError, Errno::ENOENT => e
Compat::UI.error e.message
throw :task_has_failed
end
Expand Down Expand Up @@ -124,9 +125,12 @@ def autorun?

def _run(*args)
Compat::UI.debug "Running: #{args.join(' ')}"
return $CHILD_STATUS.exitstatus unless Kernel.system(*args).nil?
out, err, st = Open3.capture3(*args)
return st.exitstatus unless st.exitstatus.nil?

fail Errno::ENOENT, args.join(' ')
fail "Failed to execute #{args.join}, #{st}"
rescue Errno::ENOENT => e
fail Errno::ENOENT, args.join
end

def _run_possibly_bundled_command(paths, all)
Expand Down
Loading