fix a few verbose reporter bugs

This commit is contained in:
John Bintz 2012-01-12 16:47:36 -05:00
parent 5d43eb2193
commit 09842c0539
4 changed files with 33 additions and 19 deletions

View File

@ -150,6 +150,8 @@ module Jasmine
sleep 0.1
end
Jasmine::Headless.warn "HTTP powered specs!"
yield
Thread.kill(server)

View File

@ -80,15 +80,18 @@ if window.JHW
puts msg
JHW.createCoffeeScriptFileException = (e) ->
if e and e.sourceURL and window.CoffeeScriptToFilename
if e and e.sourceURL
filename = e.sourceURL.split('/').pop()
if realFilename = window.CoffeeScriptToFilename[filename]
e = {
name: e.name,
message: e.message,
lineNumber: "~" + String(e.line),
sourceURL: realFilename
}
e =
name: e.name
message: e.message
sourceURL: e.sourceURL
lineNumber: e.line
if window.CoffeeScriptToFilename and realFilename = window.CoffeeScriptToFilename[filename]
e.sourceURL = realFilename
e.lineNumber = "~" + String(e.line)
e

View File

@ -1,6 +1,8 @@
#= require jasmine.HeadlessReporter.ConsoleBase
#
class jasmine.HeadlessReporter.Verbose extends jasmine.HeadlessReporter.ConsoleBase
@prereport = false
displaySuccess: (spec) =>
this.displaySpec(spec, 'green')
@ -46,12 +48,17 @@ class jasmine.HeadlessReporter.Verbose extends jasmine.HeadlessReporter.ConsoleB
colorLine: (line, color) =>
line.foreground(color)
reportSpecStarting: (spec) =>
if jasmine.HeadlessReporter.Verbose.prereport
this.puts(spec.getSpecSplitName().join(' '))
reportException: (e) =>
e = JHW.createCoffeeScriptFileException(e)
output = e.message
if e.sourceURL && e.lineNumber
output = "#{e.sourceURL}:~#{e.lineNumber} #{output}"
output = "#{e.sourceURL}:#{e.lineNumber} #{e.message}"
else
output = e.message ? e
this.puts(output.foreground('yellow'))

View File

@ -84,15 +84,17 @@
};
JHW.createCoffeeScriptFileException = function(e) {
var filename, realFilename;
if (e && e.sourceURL && window.CoffeeScriptToFilename) {
if (e && e.sourceURL) {
filename = e.sourceURL.split('/').pop();
if (realFilename = window.CoffeeScriptToFilename[filename]) {
e = {
name: e.name,
message: e.message,
lineNumber: "~" + String(e.line),
sourceURL: realFilename
sourceURL: e.sourceURL,
lineNumber: e.line
};
if (window.CoffeeScriptToFilename && (realFilename = window.CoffeeScriptToFilename[filename])) {
e.sourceURL = realFilename;
e.lineNumber = "~" + String(e.line);
}
}
return e;