module Pico::TestRunner

Public Instance Methods

load_test_files_in(test_dir) click to toggle source
# File lib/pico/test_runner.rb, line 18
def load_test_files_in(test_dir)
  path = Pico.application.root.join(test_dir)
  return unless path.directory?
  $LOAD_PATH << path
  Dir[path.join("**/*_#{test_dir}.rb")].each do |test_file|
    load test_file
  end
end
run!() click to toggle source
# File lib/pico/test_runner.rb, line 5
def run!
  Bundler.require :test

  pid = fork do
    Pico.shutdown! # For when we're inside pry
    %w(test spec).each do |test_dir| load_test_files_in test_dir; end
    Minitest.autorun
  end

  _, status = Process.wait2 pid
  status.exitstatus == 0
end