0
@@ -31,10 +31,12 @@ describe HtmlFormatter, "#start" do
0
it "prints the HTML head" do
0
+%[<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
0
+ "http://www.w3.org/TR/html4/strict.dtd">
0
-<title>Spec Output For #{RUBY_NAME} (#{RUBY_VERSION})</title>
0
-<script type="text/css">
0
+<title>Spec Output For ruby (1.8.6)</title>
0
+<style type="text/css">
0
+ background-color: #ffffe0;
0
@@ -105,7 +110,10 @@ describe HtmlFormatter, "#after" do
0
@state.exceptions << ["msg", MSpecExampleError.new("painful")]
0
@formatter.tally.after @state
0
@formatter.after @state
0
- @out.should == %[<li class="fail">- it (FAILED - 1)</li>\n<li class="fail">- it (ERROR - 2)</li>\n]
0
+%[<li class="fail">- it (<a href="#details-1">FAILED - 1</a>)</li>
0
+<li class="fail">- it (<a href="#details-2">ERROR - 2</a>)</li>
0
@@ -121,6 +129,8 @@ describe HtmlFormatter, "#finish" do
0
@formatter = HtmlFormatter.new
0
+ @exception = MSpecExampleError.new("broken")
0
+ @exception.stub!(:backtrace).and_return(["file.rb:1", "file.rb:2"])
0
@@ -128,7 +138,7 @@ describe HtmlFormatter, "#finish" do
0
it "prints a failure message for an exception" do
0
- @state.exceptions << ["msg",
MSpecExampleError.new("broken")]
0
+ @state.exceptions << ["msg",
@exception]
0
@formatter.instance_variable_set :@states, [@state]
0
@out.should =~ %r[<p>describe it ERROR</p>]
0
@@ -136,7 +146,7 @@ describe HtmlFormatter, "#finish" do
0
it "prints a backtrace for an exception" do
0
@formatter.stub!(:backtrace).and_return("path/to/some/file.rb:35:in method")
0
- @state.exceptions << ["msg",
MSpecExampleError.new("broken")]
0
+ @state.exceptions << ["msg",
@exception]
0
@formatter.instance_variable_set :@states, [@state]
0
@out.should =~ %r[<pre>.*path/to/some/file.rb:35:in method.*</pre>]m
0
@@ -155,15 +165,16 @@ describe HtmlFormatter, "#finish" do
0
it "prints errors, backtraces, elapsed time, and tallies" do
0
- @state.exceptions << ["msg",
MSpecExampleError.new("broken")]
0
+ @state.exceptions << ["msg",
@exception]
0
@formatter.stub!(:backtrace).and_return("path/to/some/file.rb:35:in method")
0
@timer.should_receive(:format).and_return("Finished in 2.0 seconds")
0
@tally.should_receive(:format).and_return("1 example, 1 failures")
0
@formatter.instance_variable_set :@states, [@state]
0
-<li><p>describe it ERROR</p>
0
+<li id="details-1"><p>describe it ERROR</p>
0
<p>MSpecExampleError: broken</p>
0
path/to/some/file.rb:35:in method</pre>