Sha256: 32d7b1368ab5a12999c17ab2fa8b231a936191bedaf5e3488849a7fb9bca6a31

Contents?: true

Size: 857 Bytes

Versions: 1

Compression:

Stored size: 857 Bytes

Contents

module CucumberAnalytics
  class OutlineExample < FeatureElement


    attr_accessor :tags
    attr_accessor :rows


    # Creates a new OutlineExample object and, if *source_lines* is provided,
    # populates the object.
    def initialize(source_lines = nil)
      super

      @tags = []
      @rows = []

      parse_example(source_lines) if source_lines
    end


    private


    def parse_example(source_lines)
      parse_feature_element_tags(source_lines)
      parse_feature_element(source_lines)
      rows.concat source_lines.collect { |line| line.strip }
    end

    def parse_feature_element_description(source_lines)
      until source_lines.first =~ /^\s*\|/ or
          source_lines.empty?

        @description << source_lines.first.strip
        source_lines.shift
      end
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cucumber_analytics-0.0.2 lib/cucumber_analytics/outline_example.rb