Sha256: 0eedc3356655c9b82063b672dd16b433f2485a262ad4f8c8c7571e5ae9acd518

Contents?: true

Size: 774 Bytes

Versions: 7

Compression:

Stored size: 774 Bytes

Contents

require 'gherkin/tag_expression'
module CukeForker
  module Formatters
    class ScenarioLineLogger
      attr_reader :scenarios

      def initialize(tag_expression = Gherkin::TagExpression.new([]))
        @scenarios = []
        @tag_expression = tag_expression
      end

      def visit_feature_element(feature_element)
        if @tag_expression.evaluate(feature_element.source_tags)
          line_number = if feature_element.respond_to?(:line)
                          feature_element.line
                        else
                          feature_element.location.line
                        end

          @scenarios << [feature_element.feature.file, line_number].join(':')
        end
      end

      def method_missing(*args)
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
cukeforker-0.2.5 lib/cukeforker/formatters/scenario_line_logger.rb
cukeforker-0.2.4 lib/cukeforker/formatters/scenario_line_logger.rb
cukeforker-0.2.3 lib/cukeforker/formatters/scenario_line_logger.rb
cukeforker-0.2.2 lib/cukeforker/formatters/scenario_line_logger.rb
cukeforker-0.2.1 lib/cukeforker/formatters/scenario_line_logger.rb
cukeforker-0.2.0 lib/cukeforker/formatters/scenario_line_logger.rb
cukeforker-0.1.9 lib/cukeforker/formatters/scenario_line_logger.rb