class RSpec::Core::Formatters::HtmlPrinter
Constants
- YALE_GLOBAL_STYLES
- YALE_HTML_HEADER
- YALE_REPORT_HEADER
Public Instance Methods
print_example_group_start( group_id, description, number_of_parents )
click to toggle source
# File lib/magicspec/generators/magicspec/app/spec/support/formatters/html_override.rb, line 16 def print_example_group_start( group_id, description, number_of_parents ) @output.puts "<div id=\"div_group_#{group_id}\" class=\"example_group passed\">" @output.puts " <dl #{indentation_style(number_of_parents)}>" @output.puts " <dt id=\"example_group_#{group_id}\" class=\"passed\">#{h(description)}</dt>" end
print_html_start()
click to toggle source
# File lib/magicspec/generators/magicspec/app/spec/support/formatters/html_override.rb, line 11 def print_html_start @output.puts YALE_HTML_HEADER @output.puts YALE_REPORT_HEADER end
print_summary( was_dry_run, duration, example_count, failure_count, pending_count )
click to toggle source
# File lib/magicspec/generators/magicspec/app/spec/support/formatters/html_override.rb, line 22 def print_summary( was_dry_run, duration, example_count, failure_count, pending_count ) # TODO - kill dry_run? if was_dry_run totals = "This was a dry-run" else totals = "#{example_count} example#{'s' unless example_count == 1}, " totals << "#{failure_count} failure#{'s' unless failure_count == 1}" totals << ", #{pending_count} pending" if pending_count > 0 end formatted_duration = sprintf("%.5f", duration) @output.puts "<script type=\"text/javascript\">document.getElementById('duration').innerHTML = \"Finished in <strong>#{formatted_duration} seconds</strong>\";</script>" @output.puts "<script type=\"text/javascript\">document.getElementById('totals').innerHTML = \"#{totals}\";</script>" @output.puts "</div>" @output.puts "</div>" @output.puts "</body>" @output.puts "</html>" end