require 'rake' require 'rake/testtask' module Henry class Task # The Henry Task implementation for MiniTest class MiniTestTask < Task # The temporary output file path for the MiniTest execution. OUT_PATH = 'minitest.out' # The reports path template. REPORTS_DIR = '.henry/reports/minitest' # Executes the Task and returns its results. def execute begin Rake.application['minitest'].invoke self.execution.code = 'OK' self.execution.message = 'OK' self.execution.output = File.open(OUT_PATH, 'r').read rescue Exception => e self.execution.code = 'ERROR' self.execution.message = 'ERROR' self.execution.output = File.open(OUT_PATH, 'r').read self.execution.backtrace = e.message end end # Configures the Task. # # @param [Hash] params the task params. def configure(params, extended_context={}) File.open(OUT_PATH, 'w') { |f| } pattern = params['pattern'] || './spec{,/*/**}/*_spec.rb' format = params['format'] || 'SpecReporter' File.open("preconfig.rb", 'w') do |f| f.write <