Sha256: 83f99383f7786a18eb3cc8dfdfe6c9565f9dcbd7afec84b57f96a45ef6ae9d00

Contents?: true

Size: 686 Bytes

Versions: 3

Compression:

Stored size: 686 Bytes

Contents

module CucumberSpinner

  class CuriousProgressBarFormatter < ProgressBarFormatter

    def after_table_row(*)
      @in_scenario_outline = true
      super
    ensure
      @in_scenario_outline = false
    end

    def failed!
      super
      if @in_scenario_outline
        puts "Cannot show you the page with the error, that does not work with scenario outlines."
        puts
      else
        show_the_page
      end
    end

    def show_the_page
      step_mother.step_match('show me the page').invoke(nil)
    rescue StandardError => e
      puts "Tried to show you the page with the error, but it failed due to #{e.class.name}: #{e.message}"
      puts
    end

  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
cucumber_spinner-0.2.5 lib/cucumber_spinner/curious_progress_bar_formatter.rb
cucumber_spinner-0.2.4 lib/cucumber_spinner/curious_progress_bar_formatter.rb
cucumber_spinner-0.2.3 lib/cucumber_spinner/curious_progress_bar_formatter.rb