Class: SpecTracker::ReportTask
- Inherits:
-
Object
- Object
- SpecTracker::ReportTask
- Defined in:
- lib/spec_tracker/report_task.rb
Instance Attribute Summary collapse
-
#report_mapper ⇒ Object
readonly
Returns the value of attribute report_mapper.
-
#reporter ⇒ Object
readonly
Returns the value of attribute reporter.
-
#spec_parser ⇒ Object
readonly
Returns the value of attribute spec_parser.
-
#test_report_parser ⇒ Object
readonly
Returns the value of attribute test_report_parser.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize ⇒ ReportTask
constructor
A new instance of ReportTask.
Constructor Details
#initialize ⇒ ReportTask
Returns a new instance of ReportTask.
5 6 7 8 9 10 11 |
# File 'lib/spec_tracker/report_task.rb', line 5 def initialize spec_type = SpecTracker.configuration.spec_type @spec_parser = (spec_type == %q{gherkin}) ? SpecParser::GherkinParser.new : SpecParser::CSVParser.new @test_report_parser = TestReportParser::JUnit::Parser.new @report_mapper = Reporter::ReportMapper.new @reporter = Reporter::Terminal::Reporter.new end |
Instance Attribute Details
#report_mapper ⇒ Object (readonly)
Returns the value of attribute report_mapper.
3 4 5 |
# File 'lib/spec_tracker/report_task.rb', line 3 def report_mapper @report_mapper end |
#reporter ⇒ Object (readonly)
Returns the value of attribute reporter.
3 4 5 |
# File 'lib/spec_tracker/report_task.rb', line 3 def reporter @reporter end |
#spec_parser ⇒ Object (readonly)
Returns the value of attribute spec_parser.
3 4 5 |
# File 'lib/spec_tracker/report_task.rb', line 3 def spec_parser @spec_parser end |
#test_report_parser ⇒ Object (readonly)
Returns the value of attribute test_report_parser.
3 4 5 |
# File 'lib/spec_tracker/report_task.rb', line 3 def test_report_parser @test_report_parser end |
Instance Method Details
#execute ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/spec_tracker/report_task.rb', line 13 def execute specifications = spec_parser.parse(SpecTracker.configuration.spec_path) test_results = test_report_parser.parse(SpecTracker.configuration.test_report_path) specifications.map do |specification| report = report_mapper.map( topic: specification.topic, scenarios: specification.scenarios, test_results: test_results ) reporter.print(report) end end |