File tree Expand file tree Collapse file tree 2 files changed +62
-56
lines changed Expand file tree Collapse file tree 2 files changed +62
-56
lines changed Original file line number Diff line number Diff line change 1
1
require 'guard/minitest/inspector'
2
2
require 'English'
3
+ require 'open3'
3
4
4
5
module Guard
5
6
class Minitest < Plugin
@@ -40,7 +41,7 @@ def run(paths, options = {})
40
41
41
42
begin
42
43
status = _run_possibly_bundled_command ( paths , options [ :all ] )
43
- rescue Errno ::ENOENT => e
44
+ rescue RuntimeError , Errno ::ENOENT => e
44
45
Compat ::UI . error e . message
45
46
throw :task_has_failed
46
47
end
@@ -124,9 +125,12 @@ def autorun?
124
125
125
126
def _run ( *args )
126
127
Compat ::UI . debug "Running: #{ args . join ( ' ' ) } "
127
- return $CHILD_STATUS. exitstatus unless Kernel . system ( *args ) . nil?
128
+ out , err , st = Open3 . capture3 ( *args )
129
+ return st . exitstatus unless st . exitstatus . nil?
128
130
129
- fail Errno ::ENOENT , args . join ( ' ' )
131
+ fail "Failed to execute #{ args . join } , #{ st } "
132
+ rescue Errno ::ENOENT => e
133
+ fail Errno ::ENOENT , args . join
130
134
end
131
135
132
136
def _run_possibly_bundled_command ( paths , all )
You can’t perform that action at this time.
0 commit comments