Class: Guard::Minitest::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/guard/jruby-minitest/runner.rb

Instance Method Summary collapse

Instance Method Details

#_run_command(paths, all) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/guard/jruby-minitest/runner.rb', line 5

def _run_command(paths, all)
  $LOAD_PATH << 'test' unless $LOAD_PATH.include?('test')
  paths.each {|path| reload path, all}

  # if ::MiniTest.respond_to?(:run) # minitest 5
  if Utils.minitest_version_gte_5?
    ::MiniTest.run(ARGV)
    ::MiniTest.class_variable_get(:@@after_run).reverse_each(&:call)
  else
    ::Minitest::Unit.runner = nil # resets the runner for minitest
    ::MiniTest::Unit.new.run(ARGV)
    ::MiniTest::Unit.class_variable_get(:@@after_tests).reverse_each(&:call)
  end
end

#run_on_modifications(paths = []) ⇒ Object



20
21
22
23
# File 'lib/guard/jruby-minitest/runner.rb', line 20

def run_on_modifications(paths = [])
  paths = inspector.clean(paths)
  run(paths, all: false) # always reloads each test file
end