module Spec class BrowserFormatter CSS = <<-EOS body { font-size: 14px; font-family: Helvetica Neue, Helvetica, Arial, sans-serif; } pre { font-family: "Bitstream Vera Sans Mono", Monaco, "Lucida Console", monospace; font-size: 12px; color: #444444; white-space: pre; padding: 3px 0px 3px 12px; margin: 0px 0px 8px; background: #FAFAFA; -webkit-box-shadow: rgba(0,0,0,0.07) 0 1px 2px inset; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; border: 1px solid #DDDDDD; } ul.example_groups { list-style-type: none; } li.group.passed .group_description { color: #597800; font-weight: bold; } li.group.failed .group_description { color: #FF000E; font-weight: bold; } li.example.passed { color: #597800; } li.example.failed { color: #FF000E; } .examples { list-style-type: none; } EOS def initialize @examples = [] @failed_examples = [] end def start raise "Not running in browser" unless Document.body_ready? @summary_element = DOM.parse '
' @summary_element.append_to_body @groups_element = DOM.parse '#{ output }HTML wrapper << description wrapper << exception @example_list.append wrapper @example_list.css 'display', 'list-item' end def example_passed example out = DOM.parse <<-HTML