Sha256: 075ce86693e09c142590461c8d0269d4e56def4069a7026bb76bd55198288476

Contents?: true

Size: 1023 Bytes

Versions: 1

Compression:

Stored size: 1023 Bytes

Contents

require 'minitest/autorun'

module Guard
  class Minitest
    class Runner

      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

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

      private

        def reload(path, all)
          if all
           load path
          else
            ::Guard::JRubyMinitest::TestPathsReloader.run([path])
          end
        end

    end
  end
end


Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
guard-jruby-minitest-0.1.6 lib/guard/jruby-minitest/runner.rb