Updated JSpec
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by visionmedia · committed by visionmedia · parent 44cc5ac · Browse files · 3 files·+20 added−18 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
3 files+20 added−18 removed
- tests:+20 added−18 removed
Provenance
- Commit
8e48120- Tree
5de8f0e- Author
visionmedia <tj@vision-media.ca>- Committer
visionmedia <tj@vision-media.ca>- Parent
44cc5ac
3 files changed+20 added−18 removed
modified:spec/lib/jspec.js+17 added-13 removed
2 unmodified lines3 4 ;(function(){5 6 JSpec = {7- version : '4.2.1',7+ version : '4.3.2',8 assert : true,9 cache : {},10 suites : [],11 modules : [],1736 unmodified lines1748 }1749 1750 // --- Node.js support1751 1752- if (typeof GLOBAL === 'object' && typeof exports === 'object')1753- quit = process.exit,1754- print = require('sys').puts,1755- readFile = require('fs').readFileSync1752+ if (typeof GLOBAL === 'object' && typeof exports === 'object') {1753+ var fs = require('fs')1754+ quit = process.exit1755+ print = require('sys').puts1756+ readFile = function(file){1757+ return fs.readFileSync(file).toString('utf8')1758+ }1759+ }1760 1761 // --- Utility functions1762 1763 var main = this,111 unmodified lines1875 return length >= range.shift() && length <= range.pop()1876 },1877 1878 have_prop : function(actual, property, value) {1875- return actual[property] === undefined ||1876- actual[property] instanceof Function ? false:1877- value === undefined ? true:1878- does(actual[property], 'eql', value)1879+ var actualVal = actual[property], actualType = typeof actualVal1880+ return (actualType == 'function' || actualType == 'undefined') ? false :1881+ typeof value === 'undefined' ||1882+ does(actual[property],'eql',value)1883 },1884 1885 have_property : function(actual, property, value) {1882- return actual[property] === undefined ||1883- actual[property] instanceof Function ? false:1884- value === undefined ? true:1885- value === actual[property]1886+ var actualVal = actual[property], actualType = typeof actualVal1887+ return (actualType == 'function' || actualType == 'undefined') ? false :1888+ typeof value === 'undefined' ||1889+ value === actualVal1890 }1891 })1892 1893 })()modified:spec/lib/jspec.xhr.js+3 added-1 removed
32 unmodified lines33 * Return response headers hash.34 */35 36 getAllResponseHeaders : function(){37- return this.responseHeaders37+ return JSpec.inject(this.responseHeaders, '', function(buf, key, val){38+ return buf + key + ': ' + val + '\r\n'39+ })40 },41 42 /**43 * Return case-insensitive value for header _name_.167 unmodified linesmodified:spec/node.js-4 removed
2 unmodified lines3456789107891034 unmodified lines2 unmodified linesrequire("jspec")require("express")require("express/spec")
print = require('sys').putsquit = process.exitreadFile = require('fs').readFileSync
function run(specs) { specs.forEach(function(spec){ JSpec.exec('spec/spec.' + spec + '.js') })34 unmodified lines