Sha256: 5b64e3c3674d4d16821e3c69f68a169c42ecd6dbb7a0b5c5852490292fac11c7

Contents?: true

Size: 847 Bytes

Versions: 11

Compression:

Stored size: 847 Bytes

Contents

require 'cucumber/formatter/io'

module Cucumber
  module Formatter
    class Rerun
      include Formatter::Io

      def initialize(runtime, path_or_io, options)
        @io = ensure_io(path_or_io)
        @failures = {}
        @options = options
      end

      def after_test_case(test_case, result)
        return if result.ok?(@options[:strict])
        @failures[test_case.location.file] ||= []
        @failures[test_case.location.file] << test_case.location.line
      end

      def done
        return if @failures.empty?
        @io.print file_failures.join(' ')
      end

      [:before_test_case, :before_test_step, :after_test_step].each do |method|
        define_method(method) { |*| }
      end

      private
      def file_failures
        @failures.map { |file, lines| [file, lines].join(':') }
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
cucumber-2.99.0 lib/cucumber/formatter/rerun.rb
mobiusloop-0.1.5 lib/cucumber/formatter/rerun.rb
cucumber-2.4.0 lib/cucumber/formatter/rerun.rb
mobiusloop-0.1.3 lib/cucumber/formatter/rerun.rb
mobiusloop-0.1.2 lib/cucumber/formatter/rerun.rb
cucumber-2.3.3 lib/cucumber/formatter/rerun.rb
cucumber-2.3.2 lib/cucumber/formatter/rerun.rb
cucumber-2.3.1 lib/cucumber/formatter/rerun.rb
cucumber-2.3.0 lib/cucumber/formatter/rerun.rb
cucumber-2.2.0 lib/cucumber/formatter/rerun.rb
cucumber-2.1.0 lib/cucumber/formatter/rerun.rb