lib/jspec.js in visionmedia-jspec-1.1.1 vs lib/jspec.js in visionmedia-jspec-1.1.3
- old
+ new
@@ -3,11 +3,11 @@
(function(){
JSpec = {
- version : '1.1.1',
+ version : '1.1.3',
main : this,
suites : [],
matchers : {},
stats : { specs : 0, assertions : 0, failures : 0, passes : 0 },
options : { profile : false },
@@ -170,19 +170,16 @@
displaySuite = failuresOnly ? suite.ran && !suite.passed() : suite.ran
if (displaySuite && suite.hasSpecs()) {
markup += '<tr class="description"><td colspan="2">' + suite.description + '</td></tr>'
each(suite.specs, function(i, spec){
markup += '<tr class="' + (i % 2 ? 'odd' : 'even') + '">'
- if (spec.requiresImplementation() && !failuresOnly) {
+ if (spec.requiresImplementation() && !failuresOnly)
markup += '<td class="requires-implementation" colspan="2">' + spec.description + '</td>'
- }
- else if (spec.passed() && !failuresOnly) {
+ else if (spec.passed() && !failuresOnly)
markup += '<td class="pass">' + spec.description+ '</td><td>' + spec.assertionsGraph() + '</td>'
- }
- else if(!spec.passed()) {
+ else if(!spec.passed())
markup += '<td class="fail">' + spec.description + ' <em>' + spec.failure().message + '</em>' + '</td><td>' + spec.assertionsGraph() + '</td>'
- }
markup += '<tr class="body" style="display: none;"><td colspan="2">' + spec.body + '</td></tr>'
})
markup += '</tr>'
}
}
@@ -775,16 +772,13 @@
request = new XMLHttpRequest
request.open('GET', file, false)
request.send(null)
if (request.readyState == 4) return request.responseText
}
- else if ('load' in this.main) {
- // TODO: workaround for IO issue / preprocessing
- load(file)
- }
- else {
+ else if ('load' in this.main)
+ load(file) // TODO: workaround for IO issue / preprocessing
+ else
error('cannot load ' + file)
- }
},
/**
* Load, pre-process, and evaluate a file.
*