Sha256: d2e3da991718643775834827cad082ef073e67bff097381e8fb3fb7893cf8947
Contents?: true
Size: 1.33 KB
Versions: 19
Compression:
Stored size: 1.33 KB
Contents
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' # The reports path template. REPORTS_DIR = '.henry/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 # 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 <<CODE $stdout = File.open('#{OUT_PATH}', 'w') require 'minitest/autorun' require 'minitest/reporters' MiniTest::Reporters.use! MiniTest::Reporters::#{format}.new CODE end # Makes available the spec rake task. Rake::TestTask.new('minitest') do |t| t.pattern = pattern t.ruby_opts << "-r ./preconfig" end self.export_params(params) end end end end
Version data entries
19 entries across 19 versions & 1 rubygems