Skip to content

Commit

Permalink
fix step exceptions.
Browse files Browse the repository at this point in the history
  • Loading branch information
gongo committed May 28, 2014
1 parent ba80ad8 commit bce32cb
Showing 1 changed file with 18 additions and 11 deletions.
29 changes: 18 additions & 11 deletions lib/turnip_formatter/step_template/exception.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,16 @@ class Exception < Base
def self.scss
<<-EOS
div#steps-statistics section.scenario {
ul.steps {
div.steps {
div.step_exception {
margin: 1em 0em;
padding: 1em 0em 1em 1em;
padding: 1em;
border: 1px solid #999999;
background-color: #eee8d5;
color: #586e75;
> pre {
dd {
margin-top: 1em;
margin-left: 1em;
}
}
Expand Down Expand Up @@ -53,14 +54,20 @@ def build(exception)
def template_step_exception
@template_step_exception ||= ERB.new(<<-EOS)
<div class="step_exception">
<span>Failure:</span>
<pre><%= ERB::Util.h(exception.to_s) %></pre>
<span>Backtrace:</span>
<ol>
<% exception.backtrace.each do |line| %>
<li><%= ERB::Util.h(line) %></li>
<% end %>
</ol>
<dl>
<dt>Failure:</dt>
<dd>
<pre><%= ERB::Util.h(exception.to_s) %></pre>
</dd>
<dt>Backtrace:</dt>
<dd>
<ol>
<% exception.backtrace.each do |line| %>
<li><%= ERB::Util.h(line) %></li>
<% end %>
</ol>
</dd>
</dl>
</div>
EOS
end
Expand Down

0 comments on commit bce32cb

Please sign in to comment.