Class: Henry::Task::RspecTask
- Inherits:
-
RakeTask
- Object
- Henry::Task
- RakeTask
- Henry::Task::RspecTask
- Defined in:
- lib/henry/task/rspec_task.rb
Overview
The Henry Task implementation for Rspec
Constant Summary collapse
- OUT_PATH =
The temporary output file path for the RspecTask execution.
'rspec.out'
- DEFAULT_OUTPUT_BASE_DIR =
Default base output directory
'.output'
- REPORTS_DIR =
The reports path template.
'reports/${FORMAT}'
- TIME_FORMAT =
Default time format to be used in the reports filepath.
'%Y-%m-%dT%H%M%S'
- APPLICATION_NAME =
The Rspec Rake Application name.
'spec'
Instance Attribute Summary collapse
-
#generated_reports ⇒ Object
Returns the value of attribute generated_reports.
-
#report_recipients ⇒ Object
Returns the value of attribute report_recipients.
Attributes inherited from Henry::Task
#data, #enabled, #name, #timeout
Instance Method Summary collapse
- #after_execute ⇒ Object
- #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
#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 Attribute Details
#generated_reports ⇒ Object
Returns the value of attribute generated_reports.
11 12 13 |
# File 'lib/henry/task/rspec_task.rb', line 11 def generated_reports @generated_reports end |
#report_recipients ⇒ Object
Returns the value of attribute report_recipients.
11 12 13 |
# File 'lib/henry/task/rspec_task.rb', line 11 def report_recipients @report_recipients end |
Instance Method Details
#after_execute ⇒ Object
38 39 40 |
# File 'lib/henry/task/rspec_task.rb', line 38 def after_execute super end |
#application_name ⇒ Object
30 31 32 |
# File 'lib/henry/task/rspec_task.rb', line 30 def application_name APPLICATION_NAME end |
#base_output_path ⇒ String
Returns output base path
45 46 47 |
# File 'lib/henry/task/rspec_task.rb', line 45 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.
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/henry/task/rspec_task.rb', line 53 def configure(params, extended_context={}) File.open(OUT_PATH, 'w') { |f| } # Makes available the spec rake task. Rake.application.clear RSpec::Core::RakeTask.new do |t| if self.data. t.pattern = self.data.['pattern'] || 'spec/*' t.rspec_opts = "#{self.(extended_context['options']||{})}" else t.pattern = 'spec/*' t.rspec_opts = "#{self.} #{extended_context['options']}" end end super end |
#out_path ⇒ Object
34 35 36 |
# File 'lib/henry/task/rspec_task.rb', line 34 def out_path OUT_PATH end |