Permalink
Browse files

corrected the count in the html formater

- Closes #265.
  • Loading branch information...
1 parent 5dc63b1 commit ad79868832a017898c36233bf4f4d65ea409ce33 @scrummyin scrummyin committed with dchelimsky Jan 3, 2011
@@ -72,7 +72,7 @@ def example_passed(example)
end
def example_failed(example)
- counter = 0
+ super(example)
exception = example.metadata[:execution_result][:exception]
extra = extra_failure_content(exception)
failure_style = 'failed'
@@ -84,7 +84,7 @@ def example_failed(example)
move_progress
@output.puts " <dd class=\"spec #{failure_style}\">"
@output.puts " <span class=\"failed_spec_name\">#{h(example.description)}</span>"
- @output.puts " <div class=\"failure\" id=\"failure_#{counter}\">"
+ @output.puts " <div class=\"failure\" id=\"failure_#{@failed_examples.size}\">"
@output.puts " <div class=\"message\"><pre>#{h(exception.message)}</pre></div>" unless exception.nil?
@output.puts " <div class=\"backtrace\"><pre>#{format_backtrace(exception.backtrace, example).join("\n")}</pre></div>" if exception
@output.puts extra unless extra == ""
@@ -210,7 +210,7 @@
<script type="text/javascript">moveProgressBar('42.8');</script>
<dd class="spec pending_fixed">
<span class="failed_spec_name">fails</span>
- <div class="failure" id="failure_0">
+ <div class="failure" id="failure_1">
<div class="message"><pre>RSpec::Core::PendingExampleFixedError</pre></div>
<div class="backtrace"><pre>./spec/rspec/core/resources/formatter_specs.rb:18
./spec/rspec/core/formatters/html_formatter_spec.rb:24
@@ -242,7 +242,7 @@
<script type="text/javascript">moveProgressBar('71.4');</script>
<dd class="spec failed">
<span class="failed_spec_name">fails</span>
- <div class="failure" id="failure_0">
+ <div class="failure" id="failure_2">
<div class="message"><pre>
expected 2
got 1
@@ -271,7 +271,7 @@
<script type="text/javascript">moveProgressBar('85.7');</script>
<dd class="spec failed">
<span class="failed_spec_name">fails with a backtrace that has no file</span>
- <div class="failure" id="failure_0">
+ <div class="failure" id="failure_3">
<div class="message"><pre>foo</pre></div>
<div class="backtrace"><pre>(erb):1</pre></div>
<pre class="ruby"><code><span class="linenum">-1</span><span class="comment"># Couldn't get snippet for (erb)</span></code></pre>
@@ -280,7 +280,7 @@
<script type="text/javascript">moveProgressBar('100.0');</script>
<dd class="spec failed">
<span class="failed_spec_name">fails with a backtrace containing an erb file</span>
- <div class="failure" id="failure_0">
+ <div class="failure" id="failure_4">
<div class="message"><pre>Exception</pre></div>
<div class="backtrace"><pre>/foo.html.erb:1:in `<main>': foo (RuntimeError)</pre></div>
<pre class="ruby"><code><span class="linenum">-1</span><span class="comment"># Couldn't get snippet for /foo.html.erb</span></code></pre>
@@ -210,7 +210,7 @@
<script type="text/javascript">moveProgressBar('42.8');</script>
<dd class="spec pending_fixed">
<span class="failed_spec_name">fails</span>
- <div class="failure" id="failure_0">
+ <div class="failure" id="failure_1">
<div class="message"><pre>RSpec::Core::PendingExampleFixedError</pre></div>
<div class="backtrace"><pre>./spec/rspec/core/resources/formatter_specs.rb:18
./spec/rspec/core/formatters/html_formatter_spec.rb:24
@@ -243,7 +243,7 @@
<script type="text/javascript">moveProgressBar('71.4');</script>
<dd class="spec failed">
<span class="failed_spec_name">fails</span>
- <div class="failure" id="failure_0">
+ <div class="failure" id="failure_2">
<div class="message"><pre>
expected 2
got 1
@@ -273,7 +273,7 @@
<script type="text/javascript">moveProgressBar('85.7');</script>
<dd class="spec failed">
<span class="failed_spec_name">fails with a backtrace that has no file</span>
- <div class="failure" id="failure_0">
+ <div class="failure" id="failure_3">
<div class="message"><pre>foo</pre></div>
<div class="backtrace"><pre>(erb):1</pre></div>
<pre class="ruby"><code><span class="linenum">-1</span><span class="comment"># Couldn't get snippet for (erb)</span></code></pre>
@@ -282,7 +282,7 @@
<script type="text/javascript">moveProgressBar('100.0');</script>
<dd class="spec failed">
<span class="failed_spec_name">fails with a backtrace containing an erb file</span>
- <div class="failure" id="failure_0">
+ <div class="failure" id="failure_4">
<div class="message"><pre>#&lt;Class:01x11fceed&gt;</pre></div>
<div class="backtrace"><pre>/foo.html.erb:1:in `<main>': foo (RuntimeError)</pre></div>
<pre class="ruby"><code><span class="linenum">-1</span><span class="comment"># Couldn't get snippet for /foo.html.erb</span></code></pre>
@@ -210,7 +210,7 @@
<script type="text/javascript">moveProgressBar('42.8');</script>
<dd class="spec pending_fixed">
<span class="failed_spec_name">fails</span>
- <div class="failure" id="failure_0">
+ <div class="failure" id="failure_1">
<div class="message"><pre>RSpec::Core::PendingExampleFixedError</pre></div>
<div class="backtrace"><pre>./spec/rspec/core/resources/formatter_specs.rb:18
./spec/rspec/core/formatters/html_formatter_spec.rb:24
@@ -242,7 +242,7 @@
<script type="text/javascript">moveProgressBar('71.4');</script>
<dd class="spec failed">
<span class="failed_spec_name">fails</span>
- <div class="failure" id="failure_0">
+ <div class="failure" id="failure_2">
<div class="message"><pre>
expected 2
got 1
@@ -271,7 +271,7 @@
<script type="text/javascript">moveProgressBar('85.7');</script>
<dd class="spec failed">
<span class="failed_spec_name">fails with a backtrace that has no file</span>
- <div class="failure" id="failure_0">
+ <div class="failure" id="failure_3">
<div class="message"><pre>foo</pre></div>
<div class="backtrace"><pre>(erb):1</pre></div>
<pre class="ruby"><code><span class="linenum">-1</span><span class="comment"># Couldn't get snippet for (erb)</span></code></pre>
@@ -280,7 +280,7 @@
<script type="text/javascript">moveProgressBar('100.0');</script>
<dd class="spec failed">
<span class="failed_spec_name">fails with a backtrace containing an erb file</span>
- <div class="failure" id="failure_0">
+ <div class="failure" id="failure_4">
<div class="message"><pre>Exception</pre></div>
<div class="backtrace"><pre>/foo.html.erb:1:in `<main>': foo (RuntimeError)</pre></div>
<pre class="ruby"><code><span class="linenum">-1</span><span class="comment"># Couldn't get snippet for /foo.html.erb</span></code></pre>
@@ -210,7 +210,7 @@
<script type="text/javascript">moveProgressBar('42.8');</script>
<dd class="spec pending_fixed">
<span class="failed_spec_name">fails</span>
- <div class="failure" id="failure_0">
+ <div class="failure" id="failure_1">
<div class="message"><pre>RSpec::Core::PendingExampleFixedError</pre></div>
<div class="backtrace"><pre>./spec/rspec/core/resources/formatter_specs.rb:18:in `block (3 levels) in <top (required)>'
./spec/rspec/core/formatters/html_formatter_spec.rb:24:in `block (2 levels) in <module:Formatters>'
@@ -242,7 +242,7 @@
<script type="text/javascript">moveProgressBar('71.4');</script>
<dd class="spec failed">
<span class="failed_spec_name">fails</span>
- <div class="failure" id="failure_0">
+ <div class="failure" id="failure_2">
<div class="message"><pre>
expected 2
got 1
@@ -271,7 +271,7 @@
<script type="text/javascript">moveProgressBar('85.7');</script>
<dd class="spec failed">
<span class="failed_spec_name">fails with a backtrace that has no file</span>
- <div class="failure" id="failure_0">
+ <div class="failure" id="failure_3">
<div class="message"><pre>foo</pre></div>
<div class="backtrace"><pre>(erb):1:in `<main>'
./spec/rspec/core/resources/formatter_specs.rb:41:in `block (2 levels) in <top (required)>'
@@ -287,7 +287,7 @@
<script type="text/javascript">moveProgressBar('100.0');</script>
<dd class="spec failed">
<span class="failed_spec_name">fails with a backtrace containing an erb file</span>
- <div class="failure" id="failure_0">
+ <div class="failure" id="failure_4">
<div class="message"><pre>Exception</pre></div>
<div class="backtrace"><pre>/foo.html.erb:1:in `<main>': foo (RuntimeError)</pre></div>
<pre class="ruby"><code><span class="linenum">-1</span><span class="comment"># Couldn't get snippet for /foo.html.erb</span></code></pre>
@@ -210,7 +210,7 @@
<script type="text/javascript">moveProgressBar('42.8');</script>
<dd class="spec pending_fixed">
<span class="failed_spec_name">fails</span>
- <div class="failure" id="failure_0">
+ <div class="failure" id="failure_1">
<div class="message"><pre>RSpec::Core::PendingExampleFixedError</pre></div>
<div class="backtrace"><pre>./spec/rspec/core/resources/formatter_specs.rb:18:in `block (3 levels) in <top (required)>'
./spec/rspec/core/formatters/html_formatter_spec.rb:24:in `block (2 levels) in <module:Formatters>'
@@ -242,7 +242,7 @@
<script type="text/javascript">moveProgressBar('71.4');</script>
<dd class="spec failed">
<span class="failed_spec_name">fails</span>
- <div class="failure" id="failure_0">
+ <div class="failure" id="failure_2">
<div class="message"><pre>
expected 2
got 1
@@ -271,7 +271,7 @@
<script type="text/javascript">moveProgressBar('85.7');</script>
<dd class="spec failed">
<span class="failed_spec_name">fails with a backtrace that has no file</span>
- <div class="failure" id="failure_0">
+ <div class="failure" id="failure_3">
<div class="message"><pre>foo</pre></div>
<div class="backtrace"><pre>(erb):1:in `<main>'
./spec/rspec/core/resources/formatter_specs.rb:41:in `block (2 levels) in <top (required)>'
@@ -287,7 +287,7 @@
<script type="text/javascript">moveProgressBar('100.0');</script>
<dd class="spec failed">
<span class="failed_spec_name">fails with a backtrace containing an erb file</span>
- <div class="failure" id="failure_0">
+ <div class="failure" id="failure_4">
<div class="message"><pre>Exception</pre></div>
<div class="backtrace"><pre>/foo.html.erb:1:in `<main>': foo (RuntimeError)</pre></div>
<pre class="ruby"><code><span class="linenum">-1</span><span class="comment"># Couldn't get snippet for /foo.html.erb</span></code></pre>
@@ -210,7 +210,7 @@
<script type="text/javascript">moveProgressBar('42.8');</script>
<dd class="spec pending_fixed">
<span class="failed_spec_name">fails</span>
- <div class="failure" id="failure_0">
+ <div class="failure" id="failure_1">
<div class="message"><pre>RSpec::Core::PendingExampleFixedError</pre></div>
<div class="backtrace"><pre><a href="txmt://open?url=file:///Users/david/projects/ruby/rspec2/repos/rspec-core/spec/rspec/core/resources/formatter_specs.rb&line=18">./spec/rspec/core/resources/formatter_specs.rb:18</a>
<a href="txmt://open?url=file:///Users/david/projects/ruby/rspec2/repos/rspec-core/spec/rspec/core/formatters/text_mate_formatter_spec.rb&line=24">./spec/rspec/core/formatters/text_mate_formatter_spec.rb:24</a>
@@ -242,7 +242,7 @@
<script type="text/javascript">moveProgressBar('71.4');</script>
<dd class="spec failed">
<span class="failed_spec_name">fails</span>
- <div class="failure" id="failure_0">
+ <div class="failure" id="failure_2">
<div class="message"><pre>
expected 2
got 1
@@ -271,7 +271,7 @@
<script type="text/javascript">moveProgressBar('85.7');</script>
<dd class="spec failed">
<span class="failed_spec_name">fails with a backtrace that has no file</span>
- <div class="failure" id="failure_0">
+ <div class="failure" id="failure_3">
<div class="message"><pre>foo</pre></div>
<div class="backtrace"><pre>(erb):1</pre></div>
<pre class="ruby"><code><span class="linenum">-1</span><span class="comment"># Couldn't get snippet for (erb)</span></code></pre>
@@ -280,7 +280,7 @@
<script type="text/javascript">moveProgressBar('100.0');</script>
<dd class="spec failed">
<span class="failed_spec_name">fails with a backtrace containing an erb file</span>
- <div class="failure" id="failure_0">
+ <div class="failure" id="failure_4">
<div class="message"><pre>Exception</pre></div>
<div class="backtrace"><pre><a href="txmt://open?url=file:///foo.html.erb&line=1">/foo.html.erb:1</a> :in `<main>': foo (RuntimeError)</pre></div>
<pre class="ruby"><code><span class="linenum">-1</span><span class="comment"># Couldn't get snippet for /foo.html.erb</span></code></pre>
@@ -210,7 +210,7 @@
<script type="text/javascript">moveProgressBar('42.8');</script>
<dd class="spec pending_fixed">
<span class="failed_spec_name">fails</span>
- <div class="failure" id="failure_0">
+ <div class="failure" id="failure_1">
<div class="message"><pre>RSpec::Core::PendingExampleFixedError</pre></div>
<div class="backtrace"><pre><a href="txmt://open?url=file:///Users/david/projects/ruby/rspec2/repos/rspec-core/spec/rspec/core/resources/formatter_specs.rb&line=18">./spec/rspec/core/resources/formatter_specs.rb:18</a>
<a href="txmt://open?url=file:///Users/david/projects/ruby/rspec2/repos/rspec-core/spec/rspec/core/formatters/text_mate_formatter_spec.rb&line=24">./spec/rspec/core/formatters/text_mate_formatter_spec.rb:24</a>
@@ -243,7 +243,7 @@
<script type="text/javascript">moveProgressBar('71.4');</script>
<dd class="spec failed">
<span class="failed_spec_name">fails</span>
- <div class="failure" id="failure_0">
+ <div class="failure" id="failure_2">
<div class="message"><pre>
expected 2
got 1
@@ -273,7 +273,7 @@
<script type="text/javascript">moveProgressBar('85.7');</script>
<dd class="spec failed">
<span class="failed_spec_name">fails with a backtrace that has no file</span>
- <div class="failure" id="failure_0">
+ <div class="failure" id="failure_3">
<div class="message"><pre>foo</pre></div>
<div class="backtrace"><pre>(erb):1</pre></div>
<pre class="ruby"><code><span class="linenum">-1</span><span class="comment"># Couldn't get snippet for (erb)</span></code></pre>
@@ -282,7 +282,7 @@
<script type="text/javascript">moveProgressBar('100.0');</script>
<dd class="spec failed">
<span class="failed_spec_name">fails with a backtrace containing an erb file</span>
- <div class="failure" id="failure_0">
+ <div class="failure" id="failure_4">
<div class="message"><pre>#&lt;Class:01x101751&gt;</pre></div>
<div class="backtrace"><pre><a href="txmt://open?url=file:///foo.html.erb&line=1">/foo.html.erb:1</a> :in `<main>': foo (RuntimeError)</pre></div>
<pre class="ruby"><code><span class="linenum">-1</span><span class="comment"># Couldn't get snippet for /foo.html.erb</span></code></pre>
@@ -210,7 +210,7 @@
<script type="text/javascript">moveProgressBar('42.8');</script>
<dd class="spec pending_fixed">
<span class="failed_spec_name">fails</span>
- <div class="failure" id="failure_0">
+ <div class="failure" id="failure_1">
<div class="message"><pre>RSpec::Core::PendingExampleFixedError</pre></div>
<div class="backtrace"><pre><a href="txmt://open?url=file:///Users/david/projects/ruby/rspec2/repos/rspec-core/spec/rspec/core/resources/formatter_specs.rb&line=18">./spec/rspec/core/resources/formatter_specs.rb:18</a>
<a href="txmt://open?url=file:///Users/david/projects/ruby/rspec2/repos/rspec-core/spec/rspec/core/formatters/text_mate_formatter_spec.rb&line=24">./spec/rspec/core/formatters/text_mate_formatter_spec.rb:24</a>
@@ -242,7 +242,7 @@
<script type="text/javascript">moveProgressBar('71.4');</script>
<dd class="spec failed">
<span class="failed_spec_name">fails</span>
- <div class="failure" id="failure_0">
+ <div class="failure" id="failure_2">
<div class="message"><pre>
expected 2
got 1
@@ -271,7 +271,7 @@
<script type="text/javascript">moveProgressBar('85.7');</script>
<dd class="spec failed">
<span class="failed_spec_name">fails with a backtrace that has no file</span>
- <div class="failure" id="failure_0">
+ <div class="failure" id="failure_3">
<div class="message"><pre>foo</pre></div>
<div class="backtrace"><pre>(erb):1</pre></div>
<pre class="ruby"><code><span class="linenum">-1</span><span class="comment"># Couldn't get snippet for (erb)</span></code></pre>
@@ -280,7 +280,7 @@
<script type="text/javascript">moveProgressBar('100.0');</script>
<dd class="spec failed">
<span class="failed_spec_name">fails with a backtrace containing an erb file</span>
- <div class="failure" id="failure_0">
+ <div class="failure" id="failure_4">
<div class="message"><pre>Exception</pre></div>
<div class="backtrace"><pre><a href="txmt://open?url=file:///foo.html.erb&line=1">/foo.html.erb:1</a> :in `<main>': foo (RuntimeError)</pre></div>
<pre class="ruby"><code><span class="linenum">-1</span><span class="comment"># Couldn't get snippet for /foo.html.erb</span></code></pre>
@@ -210,7 +210,7 @@
<script type="text/javascript">moveProgressBar('42.8');</script>
<dd class="spec pending_fixed">
<span class="failed_spec_name">fails</span>
- <div class="failure" id="failure_0">
+ <div class="failure" id="failure_1">
<div class="message"><pre>RSpec::Core::PendingExampleFixedError</pre></div>
<div class="backtrace"><pre><a href="txmt://open?url=file:///Users/david/projects/ruby/rspec2/repos/rspec-core/spec/rspec/core/resources/formatter_specs.rb&line=18">./spec/rspec/core/resources/formatter_specs.rb:18</a> :in `block (3 levels) in <top (required)>'
<a href="txmt://open?url=file:///Users/david/projects/ruby/rspec2/repos/rspec-core/spec/rspec/core/formatters/text_mate_formatter_spec.rb&line=24">./spec/rspec/core/formatters/text_mate_formatter_spec.rb:24</a> :in `block (2 levels) in <module:Formatters>'
@@ -242,7 +242,7 @@
<script type="text/javascript">moveProgressBar('71.4');</script>
<dd class="spec failed">
<span class="failed_spec_name">fails</span>
- <div class="failure" id="failure_0">
+ <div class="failure" id="failure_2">
<div class="message"><pre>
expected 2
got 1
@@ -271,7 +271,7 @@
<script type="text/javascript">moveProgressBar('85.7');</script>
<dd class="spec failed">
<span class="failed_spec_name">fails with a backtrace that has no file</span>
- <div class="failure" id="failure_0">
+ <div class="failure" id="failure_3">
<div class="message"><pre>foo</pre></div>
<div class="backtrace"><pre>(erb):1:in `<main>'
<a href="txmt://open?url=file:///Users/david/projects/ruby/rspec2/repos/rspec-core/spec/rspec/core/resources/formatter_specs.rb&line=41">./spec/rspec/core/resources/formatter_specs.rb:41</a> :in `block (2 levels) in <top (required)>'
@@ -287,7 +287,7 @@
<script type="text/javascript">moveProgressBar('100.0');</script>
<dd class="spec failed">
<span class="failed_spec_name">fails with a backtrace containing an erb file</span>
- <div class="failure" id="failure_0">
+ <div class="failure" id="failure_4">
<div class="message"><pre>Exception</pre></div>
<div class="backtrace"><pre><a href="txmt://open?url=file:///foo.html.erb&line=1">/foo.html.erb:1</a> :in `<main>': foo (RuntimeError)</pre></div>
<pre class="ruby"><code><span class="linenum">-1</span><span class="comment"># Couldn't get snippet for /foo.html.erb</span></code></pre>
Oops, something went wrong.

0 comments on commit ad79868

Please sign in to comment.