Sha256: 9a2c4814509784180c7f07f3fd55d8b2f7f46c86d35b768effe62fe45ef7e082

Contents?: true

Size: 648 Bytes

Versions: 2

Compression:

Stored size: 648 Bytes

Contents

module Omnitest
  module Reporters
    class MarkdownReporter
      include Omnitest::Core::Util::String
      def initialize(io = $stdout)
        @buffer = io
      end

      def print_table(table)
        @buffer.puts # Markdown tables don't always render properly without a break
        header_data = table[0]
        header_line = header_data.join ' | '
        @buffer.puts header_line
        @buffer.puts header_line.gsub(/[^|]/, '-')

        table[1..-1].each do |data_line|
          @buffer.puts data_line.map { |line| escape_html(line) }.join(' | ')
        end
      end

      def colors?
        false
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
omnitest-0.2.2 lib/omnitest/reporters/markdown_reporter.rb
omnitest-0.2.1 lib/omnitest/reporters/markdown_reporter.rb