Sha256: a73a1f01e91503b76f1e4c9b8d370e1ee13179fa8857acc5294975fbea513419

Contents?: true

Size: 872 Bytes

Versions: 5

Compression:

Stored size: 872 Bytes

Contents

module ATP
  module Formatters
    # Returns the executed flow as a string of test names. This
    # is mainly intended to be used for testing the runner.
    class Basic < Formatter
      def format(node, options = {})
        @output = ''
        process(node)
        @output
      end

      def on_test(node)
        if node.find(:name)
          @output += node.find(:name).value
        else
          obj = node.find(:object).value
          obj = obj['Test'] unless obj.is_a?(String)
          @output += obj
        end
        @output += ' F' if node.find(:failed)
        @output += "\n"
      end

      def on_set_result(node)
        @output += node.to_a[0].upcase
        @output += " #{node.find(:bin).value}" if node.find(:bin)
        @output += " #{node.find(:softbin).value}" if node.find(:softbin)
        @output += "\n"
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
atp-1.1.3 lib/atp/formatters/basic.rb
atp-1.1.2 lib/atp/formatters/basic.rb
atp-1.1.1 lib/atp/formatters/basic.rb
atp-1.1.0 lib/atp/formatters/basic.rb
atp-1.0.0 lib/atp/formatters/basic.rb