From f5ec9ccff620912dc3542d5cee024c05642f3827 Mon Sep 17 00:00:00 2001
From: Michael Miller
Date: Thu, 19 Aug 2021 13:07:15 -0600
Subject: [PATCH] CSS!
The HTML report looks beautiful.
---
src/spectator/formatting/html/body.ecr | 34 ++---
src/spectator/formatting/html/head.ecr | 201 +++++++++++++++++++++++++
2 files changed, 218 insertions(+), 17 deletions(-)
diff --git a/src/spectator/formatting/html/body.ecr b/src/spectator/formatting/html/body.ecr
index c239d50..05c683f 100644
--- a/src/spectator/formatting/html/body.ecr
+++ b/src/spectator/formatting/html/body.ecr
@@ -5,8 +5,8 @@
<%- if report.counts.fail > 0 -%>
-Failures
-
+Failures (<%= report.counts.fail %>)
+
<%- report.failures.each do |example| -%>
-
@@ -14,12 +14,12 @@
<%- end -%>
-
+
<%- end -%>
<%- if report.counts.pending > 0 -%>
-Pending
-
+Pending (<%= report.counts.pending %>)
+
<%- report.pending.each do |example| -%>
-
@@ -27,24 +27,24 @@
<%- end -%>
-
+
<%- end -%>
-Examples
+Examples (<%= report.counts.total %>)
<%- if backtrace = result.error.backtrace? -%>
<%- backtrace.each do |line| -%>
@@ -54,7 +54,7 @@
<%- end -%>
<%- elsif result = example.result.as?(FailResult) -%>
-
<% escape(result.error.message) %>
+
<% escape(result.error.message) %>
<%- end -%>
<%- if example.result.expectations.empty? -%>
@@ -63,12 +63,12 @@
Expectations
<%- example.result.expectations.each do |expectation| -%>
- - ">
- title="<% escape(location) %>"<% end %>><% escape(expectation.description) %>
+
- "<% if location = expectation.location? %> title="<% escape(location) %>"<% end %>>
+ <% escape(expectation.description) %>
<%- if expectation.satisfied? -%>
- pass
+ pass
<%- else -%>
- fail
+ fail
<% escape(expectation.failure_message) %>
<%- expectation.values.each do |key, value| -%>
diff --git a/src/spectator/formatting/html/head.ecr b/src/spectator/formatting/html/head.ecr
index 118085a..a311aaa 100644
--- a/src/spectator/formatting/html/head.ecr
+++ b/src/spectator/formatting/html/head.ecr
@@ -7,6 +7,207 @@
Test Results
+
+