Use jasmine CSS, and get rid of HTML in plain text stacktrace

This commit is contained in:
Christian Williams & Erik Hanson 2009-08-07 14:11:40 -07:00
parent 331730f8f5
commit 457b5a011f
4 changed files with 5 additions and 5 deletions

View File

@ -121,7 +121,7 @@ module Jasmine
out << "\n" out << "\n"
unless message["passed"] unless message["passed"]
stack_trace = message["trace"]["stack"] stack_trace = message["trace"]["stack"].gsub(/<br \/>/, "\n").gsub(/<\/?b>/, " ")
STDERR << stack_trace.gsub(/\(.*\)@http:\/\/localhost:[0-9]+\/specs\//, "/spec/") STDERR << stack_trace.gsub(/\(.*\)@http:\/\/localhost:[0-9]+\/specs\//, "/spec/")
STDERR << "\n" STDERR << "\n"
end end

View File

@ -8,7 +8,7 @@
<script src="/jasmine/lib/TrivialReporter.js"></script> <script src="/jasmine/lib/TrivialReporter.js"></script>
<script src="/specs/javascripts/screw-jasmine-compat.js"></script> <script src="/specs/javascripts/screw-jasmine-compat.js"></script>
<script type="text/javascript"></script> <script type="text/javascript"></script>
<link href="/core/jasmine.css" rel="stylesheet"/> <link href="/jasmine/lib/jasmine.css" rel="stylesheet"/>
<script type="text/javascript"> <script type="text/javascript">
var jasmineEnv = jasmine.getEnv(); var jasmineEnv = jasmine.getEnv();
var jsApiReporter = new jasmine.JsApiReporter(); var jsApiReporter = new jasmine.JsApiReporter();

View File

@ -42,7 +42,7 @@ jasmine.TrivialReporter.prototype.reportSpecResults = function(spec) {
for (var i = 0; i < resultItems.length; i++) { for (var i = 0; i < resultItems.length; i++) {
var result = resultItems[i]; var result = resultItems[i];
if (!result.passed) { if (!result.passed) {
var resultMessageDiv = this.createDom('div', {className: 'resultMessage'}); var resultMessageDiv = this.createDom('div', {className: 'resultMessage fail'});
resultMessageDiv.innerHTML = result.message; // todo: lame; mend resultMessageDiv.innerHTML = result.message; // todo: lame; mend
specDiv.appendChild(resultMessageDiv); specDiv.appendChild(resultMessageDiv);
specDiv.appendChild(this.createDom('div', {className: 'stackTrace'}, result.trace.stack)); specDiv.appendChild(this.createDom('div', {className: 'stackTrace'}, result.trace.stack));

View File

@ -14,11 +14,11 @@ p {
padding-left: 20px; padding-left: 20px;
} }
p.fail { .fail {
background: url( ../images/fail-16.png ) no-repeat; background: url( ../images/fail-16.png ) no-repeat;
color: red; color: red;
} }
p.fail_in_summary { .fail_in_summary {
color: red; color: red;
} }