Sha256: 80268a619f8d1043fed0e6a65ad31cefe06935c6c0f44ead21926f69997e04d9

Contents?: true

Size: 884 Bytes

Versions: 23

Compression:

Stored size: 884 Bytes

Contents

module Cucumber
  module Formatter
    class Rerun < Ast::Visitor
      def initialize(step_mother, io, options)
        super(step_mother)
        @io = io
        @file_names = []
        @file_lines = Hash.new{|h,k| h[k] = []}
      end

      def visit_features(features)
        super
        files = @file_names.uniq.map do |file|
          lines = @file_lines[file]
          "#{file}:#{lines.join(':')}"
        end
        @io.puts files.join(' ')
      end

      def visit_feature_element(feature_element)
        @rerun = false
        super
        if @rerun
          file, line = *feature_element.file_line.split(':')
          @file_lines[file] << line
          @file_names << file
        end
      end

      def visit_step_name(keyword, step_name, status, step_definition, source_indent)
        @rerun = true if [:failed].index(status)
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 2 rubygems

Version Path
aslakhellesoy-cucumber-0.1.99.1 lib/cucumber/formatter/rerun.rb
aslakhellesoy-cucumber-0.1.99.10 lib/cucumber/formatter/rerun.rb
aslakhellesoy-cucumber-0.1.99.11 lib/cucumber/formatter/rerun.rb
aslakhellesoy-cucumber-0.1.99.12 lib/cucumber/formatter/rerun.rb
aslakhellesoy-cucumber-0.1.99.13 lib/cucumber/formatter/rerun.rb
aslakhellesoy-cucumber-0.1.99.14 lib/cucumber/formatter/rerun.rb
aslakhellesoy-cucumber-0.1.99.15 lib/cucumber/formatter/rerun.rb
aslakhellesoy-cucumber-0.1.99.17 lib/cucumber/formatter/rerun.rb
aslakhellesoy-cucumber-0.1.99.18 lib/cucumber/formatter/rerun.rb
aslakhellesoy-cucumber-0.1.99.19 lib/cucumber/formatter/rerun.rb
aslakhellesoy-cucumber-0.1.99.2 lib/cucumber/formatter/rerun.rb
aslakhellesoy-cucumber-0.1.99.20 lib/cucumber/formatter/rerun.rb
aslakhellesoy-cucumber-0.1.99.21 lib/cucumber/formatter/rerun.rb
aslakhellesoy-cucumber-0.1.99.22 lib/cucumber/formatter/rerun.rb
aslakhellesoy-cucumber-0.1.99.23 lib/cucumber/formatter/rerun.rb
aslakhellesoy-cucumber-0.1.99.3 lib/cucumber/formatter/rerun.rb
aslakhellesoy-cucumber-0.1.99.5 lib/cucumber/formatter/rerun.rb
aslakhellesoy-cucumber-0.1.99.6 lib/cucumber/formatter/rerun.rb
aslakhellesoy-cucumber-0.1.99.7 lib/cucumber/formatter/rerun.rb
aslakhellesoy-cucumber-0.1.99.8 lib/cucumber/formatter/rerun.rb