| 1 |
<!DOCTYPE html> |
| 2 |
<html lang="en"> |
| 3 |
<head> |
| 4 |
<title><%= title %></title> |
| 5 |
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet"> |
| 6 |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script> |
| 7 |
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script> |
| 8 |
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script> |
| 9 |
</head> |
| 10 |
|
| 11 |
<body> |
| 12 |
<div class="container"> |
| 13 |
<div class="jumbotron"> |
| 14 |
<h3><small>Generated on <%= Time.now.strftime("%b %d, %Y at %H:%M %Z") %></small></h3> |
| 15 |
<h1> |
| 16 |
<%= title %></h1> |
| 17 |
<p> |
| 18 |
Finished in <%= total_time_to_hms %>, <%= '%.2f tests/s' % (count / total_time) %>, <%= '%.2f assertions/s' % (assertions / total_time) %> |
| 19 |
</p> |
| 20 |
<p> |
| 21 |
<strong> |
| 22 |
<span class="<%= 'text-info' if (failures == 0 && errors == 0) %>"><%= '%d' % count %> tests</span>, |
| 23 |
<span class="<%= 'text-info' if (failures == 0 && errors == 0) %>"> <%= '%d' % assertions %> assertions</span>, |
| 24 |
<span class="<%= 'text-danger' if failures > 0 %>"> <%= '%d' % failures %> failures</span>, |
| 25 |
<span class="<%= 'text-danger' if errors > 0 %>"> <%= '%d' % errors %> errors</span>, |
| 26 |
<span class="<%= 'text-warning' if skips > 0 %>"> <%= '%d' % skips %> skips</span> |
| 27 |
</strong> |
| 28 |
</p> |
| 29 |
|
| 30 |
<div class="progress"> |
| 31 |
<div class="progress-bar progress-bar-info" style="width: <%= percent_passes %>%"> |
| 32 |
<%= '%d' % percent_passes %>% passed |
| 33 |
</div> |
| 34 |
<div class="progress-bar progress-bar-danger" style="width: <%= percent_errors_failures %>%"> |
| 35 |
<%= '%d' % percent_errors_failures %>% failed |
| 36 |
</div> |
| 37 |
<div class="progress-bar progress-bar-warning" style="width: <%= percent_skips %>%"> |
| 38 |
<%= '%d' % percent_skips %>% skipped |
| 39 |
</div> |
| 40 |
</div> |
| 41 |
|
| 42 |
|
| 43 |
</div> |
| 44 |
|
| 45 |
<% suites.each do |suite| %> |
| 46 |
<div class="panel panel-default"> |
| 47 |
<div class="panel-heading"><strong><%= suite[:name] %></strong> |
| 48 |
<span class="pull-right"> |
| 49 |
<span class="<%= 'text-info' if (suite[:fail_count] == 0 && suite[:error_count] == 0) %>"><%= '%d' % suite[:test_count] %> tests</span>, |
| 50 |
<span class="<%= 'text-info' if (failures == 0 && errors == 0) %>"> <%= '%d' % suite[:assertion_count] %> assertions</span>, |
| 51 |
<span class="<%= 'text-danger' if suite[:fail_count] > 0 %>"> <%= '%d' % suite[:fail_count] %> failures</span>, |
| 52 |
<span class="<%= 'text-danger' if suite[:error_count] > 0 %>"> <%= '%d' % suite[:error_count] %> errors</span>, |
| 53 |
<span class="<%= 'text-warning' if suite[:skip_count] > 0 %>"> <%= '%d' % suite[:skip_count] %> skips</span>, |
| 54 |
<span> finished in <%= '%.4fs' % suite[:time] %></span> |
| 55 |
</span> |
| 56 |
</div> |
| 57 |
<div class="panel-body"> |
| 58 |
<div class="list-group"> |
| 59 |
<% suite[:tests].each do |test| %> |
| 60 |
<div class="list-group-item"> |
| 61 |
<h5 class="list-group-item-heading"> |
| 62 |
<% if result(test) == :pass %> |
| 63 |
<span class="glyphicon glyphicon-ok text-info" aria-hidden="true"></span> |
| 64 |
<% elsif result(test) == :skip %> |
| 65 |
<span class="glyphicon glyphicon-ban-circle text-warning" aria-hidden="true"></span> |
| 66 |
<% else %> |
| 67 |
<span class="glyphicon glyphicon-remove text-danger" aria-hidden="true"></span> |
| 68 |
<% end %> |
| 69 |
<%= friendly_name(test) %> |
| 70 |
<span class="pull-right"> |
| 71 |
Assertions <%= test.assertions %>, time <%= ('%.6fs' % test.time) %> |
| 72 |
</span> |
| 73 |
</h5> |
| 74 |
<% if !test.passed? %> |
| 75 |
<pre class="list-group-item-text"><%= "#{location(test.failure)}\n\n#{test.failure.message}" %></pre> |
| 76 |
<% end %> |
| 77 |
</div> |
| 78 |
<% end %> |
| 79 |
</div> |
| 80 |
</div> |
| 81 |
</div> |
| 82 |
<% end %> |
| 83 |
</div> |
| 84 |
</body> |
| 85 |
</html> |