Sha256: f288a1923e98a26f81a7083750c1e82c5ac2ffa86c42941258a01e84d620d46a

Contents?: true

Size: 925 Bytes

Versions: 5

Compression:

Stored size: 925 Bytes

Contents

module SpecTracker
  class ReportTask
    attr_reader :spec_parser, :test_report_parser, :report_mapper, :reporter

    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

    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
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
spec_tracker-1.2.4 lib/spec_tracker/report_task.rb
spec_tracker-1.2.3 lib/spec_tracker/report_task.rb
spec_tracker-1.2.2 lib/spec_tracker/report_task.rb
spec_tracker-1.2.1 lib/spec_tracker/report_task.rb
spec_tracker-1.2.0 lib/spec_tracker/report_task.rb