Permalink
Browse files

pull over html formatter from rspec-1 and tweak to get it more or les…

…s working (needs some more love)
  • Loading branch information...
1 parent fbed3c7 commit bc80307c042badd3bf6512026427e35391c31aa9 @dchelimsky dchelimsky committed Jul 2, 2010
@@ -181,6 +181,8 @@ def formatter=(formatter_to_use)
formatter_class = case formatter_to_use.to_s
when 'd', 'doc', 'documentation', 's', 'n', 'spec', 'nested'
RSpec::Core::Formatters::DocumentationFormatter
+ when 'h', 'html'
+ RSpec::Core::Formatters::HtmlFormatter
when 'progress'
RSpec::Core::Formatters::ProgressFormatter
else
@@ -39,7 +39,7 @@ def run(example_group_instance, reporter)
@example_group_instance = example_group_instance
@example_group_instance.example = self
- start
+ start(reporter)
begin
unless pending
@@ -90,7 +90,8 @@ def around_hooks_for(example_group_class)
@example_group_class.ancestors.reverse.map{|a| a.hooks[:around][:each]}).flatten
end
- def start
+ def start(reporter)
+ reporter.example_started(self)
record :started_at => Time.now
end
@@ -3,15 +3,5 @@
require 'rspec/core/formatters/base_text_formatter'
require 'rspec/core/formatters/documentation_formatter'
require 'rspec/core/formatters/progress_formatter'
+require 'rspec/core/formatters/html_formatter'
-module RSpec
-
- module Core
-
- module Formatters
-
- end
-
- end
-
-end
@@ -58,16 +58,17 @@ def stop
@duration = Time.now - @start
end
- def example_passed(example)
+ def example_started(example)
examples << example
end
+ def example_passed(example)
+ end
+
def example_pending(example)
- examples << example
end
def example_failed(example)
- examples << example
end
# This method is invoked at the beginning of the execution of each example group.
Oops, something went wrong.

0 comments on commit bc80307

Please sign in to comment.