class Guard::Minitest::Runner

Public Instance Methods

_run_command(paths, all) click to toggle source
# 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 = []) click to toggle source
# 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

Private Instance Methods

reload(path, all) click to toggle source
# File lib/guard/jruby-minitest/runner.rb, line 27
def reload(path, all)
  if all
   load path
  else
    ::Guard::JRubyMinitest::TestPathsReloader.run([path])
  end
end