module Spec module Runner module Formatter class HtmlFormatter < BaseTextFormatter def initialize(output) super @current_behaviour_number = 0 @current_example_number = 0 end # The number of the currently running behaviour def current_behaviour_number @current_behaviour_number end # The number of the currently running example def current_example_number @current_example_number end def start(example_count) @example_count = example_count @output.puts html_header @output.puts report_header @output.flush end def add_behaviour(name) @behaviour_red = false @behaviour_red = false @current_behaviour_number += 1 unless current_behaviour_number == 1 @output.puts " " @output.puts "" end @output.puts "
#{format_backtrace(failure.exception.backtrace)}
#{@snippet_extractor.snippet(failure.exception)}
"
end
def move_progress
percent_done = @example_count == 0 ? 100.0 : (current_example_number.to_f / @example_count.to_f * 1000).to_i / 10.0
@output.puts " "
@output.flush
end
def escape(string)
string.gsub(/&/n, '&').gsub(/\"/n, '"').gsub(/>/n, '>').gsub(/ 0
end
@output.puts ""
@output.puts ""
@output.puts ""
@output.puts ""
@output.puts "