require 'rake/testtask' module Henry class Task # The Henry Task implementation for MiniTest class MiniTestTask < RakeTask # The temporary output file path for the MiniTest execution. OUT_PATH = 'minitest.out' # Default base output directory DEFAULT_OUTPUT_BASE_DIR = '.henry' # The reports path template. REPORTS_DIR = 'reports/minitest' # The Minitest Rake Application name. # # @return [String] the rake application name. APPLICATION_NAME = 'minitest' def application_name APPLICATION_NAME end def out_path OUT_PATH end # Returns output base path # # @return [String] the base output path. def base_output_path @base_output_path ||= DEFAULT_OUTPUT_BASE_PATH end # Sets the output base path. def base_output_path=(path) @base_output_path = path end # Configures the Task. # # @param [Hash] params the task params. def configure(params, extended_context={}, options={}) self.base_output_path = options[:output_directory] if options[:output_directory] File.open(OUT_PATH, 'w') { |f| } pattern = params['pattern'] || './spec{,/*/**}/*_spec.rb' format = params['format'] || 'DefaultReporter' File.open("preconfig.rb", 'w') do |f| f.write <