Sha256: ae9b8411cbcdd4eb06bb24156f1c2bd931132a21394939f41c38a4b251674d92

Contents?: true

Size: 939 Bytes

Versions: 4

Compression:

Stored size: 939 Bytes

Contents

module CucumberAnalytics

  # A class modeling a Cucumber feature's Background.

  class Background < TestElement

    # Creates a new Background object and, if *source* is provided, populates
    # the object.
    def initialize(source = nil)
      parsed_background = process_source(source)

      super(parsed_background)

      build_background(parsed_background) if parsed_background
    end

    # Returns gherkin representation of the background.
    def to_s
      text = ''

      text << "Background:#{name_output_string}"
      text << "\n" + description_output_string unless description_text.empty?
      text << "\n" unless steps.empty? || description_text.empty?
      text << "\n" + steps_output_string unless steps.empty?

      text
    end


    private


    def build_background(parsed_background)
      # Just a stub in case something specific needs to be done
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
cucumber_analytics-1.6.0 lib/cucumber_analytics/background.rb
cucumber_analytics-1.5.2 lib/cucumber_analytics/background.rb
cucumber_analytics-1.5.1 lib/cucumber_analytics/background.rb
cucumber_analytics-1.5.0 lib/cucumber_analytics/background.rb