Class: Henry::Task::MiniTestTask
- Inherits:
-
RakeTask
- Object
- Henry::Task
- RakeTask
- Henry::Task::MiniTestTask
- Defined in:
- lib/henry/task/minitest_task.rb
Overview
The Henry Task implementation for MiniTest
Constant Summary collapse
- OUT_PATH =
The temporary output file path for the MiniTest execution.
'minitest.out'
- DEFAULT_OUTPUT_BASE_DIR =
Default base output directory
'.output'
- REPORTS_DIR =
The reports path template.
'reports/minitest'
- APPLICATION_NAME =
The Minitest Rake Application name.
'minitest'
Instance Attribute Summary
Attributes inherited from Henry::Task
#data, #enabled, #name, #timeout
Instance Method Summary collapse
- #application_name ⇒ Object
-
#base_output_path ⇒ String
Returns output base path.
-
#configure(params, extended_context = {}) ⇒ Object
Configures the Task.
- #out_path ⇒ Object
Methods inherited from RakeTask
Methods inherited from Henry::Task
#after_execute, #before_execute, create, #disable!, #disabled?, #enable!, #enabled?, #execute, #execution, #execution=, #export_config, #export_params, #initialize, #logger, #report
Constructor Details
This class inherits a constructor from Henry::Task
Instance Method Details
#application_name ⇒ Object
24 25 26 |
# File 'lib/henry/task/minitest_task.rb', line 24 def application_name APPLICATION_NAME end |
#base_output_path ⇒ String
Returns output base path
35 36 37 |
# File 'lib/henry/task/minitest_task.rb', line 35 def base_output_path @base_output_path ||= (self.data.system[:output_directory] ? "#{self.data.system[:output_directory]}/output" : DEFAULT_OUTPUT_BASE_PATH) end |
#configure(params, extended_context = {}) ⇒ Object
Configures the Task.
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/henry/task/minitest_task.rb', line 42 def configure(params, extended_context={}) 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 <<CODE $stdout = File.open('#{OUT_PATH}', 'w') require 'minitest/autorun' require 'minitest/pride' 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 super end |
#out_path ⇒ Object
28 29 30 |
# File 'lib/henry/task/minitest_task.rb', line 28 def out_path OUT_PATH end |