Skip to content
Myr

Merge branch 'master' of git://github.com/visionmedia/express

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by ciaranj · committed by ciaranj · parents 99e3130, 6f995d0 · Browse files · 16 files+290 added−160 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

16 files+290 added−160 removed

  • tests:+277 added−153 removed
  • other:+13 added−7 removed

16 files+290 added−160 removed

modified:lib/express/element-collection.js+2 added-2 removed
3 unmodified lines
4/**5 * Load libxml support.6 */78var libxml = require('support/libxmljs')8var libxml = require('libxmljs')910// --- css2xpath1112/** version 0.1 2009-04-30
18 unmodified lines
31 if (typeof markup != 'string')32 return this.__super__(markup)33 if (!(/<html>/.test(markup))) 34 markup = '<html><body>' + markup + '</body></html>'35 this.document = libxml.parseString(markup)35 this.document = libxml.parseHtmlString(markup)36 this.arr = [this.document.root()]37 },38 39 /**
140 unmodified lines
modified:spec/lib/images/sprites.pngbinary

A binary file, modified.

modified:spec/lib/jspec.css+2 added-2 removed
added:spec/lib/jspec.growl.js+115 added
12// JSpec - Growl - Copyright TJ Holowaychuk <tj@vision-media.ca> (MIT Licensed)34;(function(){5 6 Growl = {7 8 // --- Version9 10 version: '1.0.0',11 12 /**13 * Execute the given _cmd_, returning an array of lines from stdout.14 *15 * Examples:16 *17 * Growl.exec('growlnotify', '-m', msg)18 *19 * @param {string ...} cmd20 * @return {array}21 * @api public22 */2324 exec: function(cmd) {25 var lines = [], line26 with (JavaImporter(java.lang, java.io)) {27 var proccess = Runtime.getRuntime().exec(Array.prototype.slice.call(arguments))28 var stream = new DataInputStream(proccess.getInputStream())29 while (line = stream.readLine())30 lines.push(line + '')31 stream.close() 32 }33 return lines34 },35 36 /**37 * Return the extension of the given _path_ or null.38 *39 * @param {string} path40 * @return {string}41 * @api private42 */43 44 extname: function(path) {45 return path.lastIndexOf('.') != -1 ? 46 path.slice(path.lastIndexOf('.') + 1, path.length) :47 null48 },4950 /**51 * Version of the 'growlnotify' binary.52 *53 * @return {string}54 * @api private55 */5657 binVersion: function() {58 try { return this.exec('growlnotify', '-v')[0].split(' ')[1] } catch (e) {}59 },6061 /**62 * Send growl notification _msg_ with _options_.63 *64 * Options:65 *66 * - title Notification title67 * - sticky Make the notification stick (defaults to false)68 * - name Application name (defaults to growlnotify)69 * - image70 * - path to an icon sets --iconpath71 * - path to an image sets --image72 * - capitalized word sets --appIcon73 * - filename uses extname as --icon74 * - otherwise treated as --icon75 *76 * Examples:77 *78 * Growl.notify('New email')79 * Growl.notify('5 new emails', { title: 'Thunderbird' })80 *81 * @param {string} msg82 * @param {options} hash83 * @api public84 */8586 notify: function(msg, options) {87 options = options || {}88 var args = ['growlnotify', '-m', msg]89 if (!this.binVersion()) throw new Error('growlnotify executable is required')90 if (image = options.image) {91 var flag, ext = this.extname(image)92 flag = flag || ext == 'icns' && 'iconpath'93 flag = flag || /^[A-Z]/.test(image) && 'appIcon'94 flag = flag || /^png|gif|jpe?g$/.test(ext) && 'image'95 flag = flag || ext && (image = ext) && 'icon'96 flag = flag || 'icon'97 args.push('--' + flag, image)98 }99 if (options.sticky) args.push('--sticky')100 if (options.name) args.push('--name', options.name)101 if (options.title) args.push(options.title)102 this.exec.apply(this, args)103 }104 }105 106 JSpec.include({107 name: 'Growl',108 reporting: function(options){109 var stats = JSpec.stats110 if (stats.failures) Growl.notify('failed ' + stats.failures + ' assertions', { title: 'JSpec'})111 else Growl.notify('passed ' + stats.passes + ' assertions', { title: 'JSpec' })112 }113 })114 115})()
modified:spec/lib/jspec.jquery.js+1 added-1 removed
45 unmodified lines
46 return !JSpec.does(actual, 'be_visible')47 },4849 have_classes : function(actual) {50 return !JSpec.any(JSpec.argumentsToArray(arguments, 1), function(arg){50 return !JSpec.any(JSpec.toArray(arguments, 1), function(arg){51 return !JSpec.does(actual, 'have_class', arg)52 })53 },54
17 unmodified lines
modified:spec/lib/jspec.js+98 added-101 removed
12// JSpec - Core - Copyright TJ Holowaychuk <tj@vision-media.ca> (MIT Licensed)34(function(){4;(function(){56 JSpec = {78 version : '2.11.13',7 version : '3.0.0',8 assert : true,9 cache : {},10 suites : [],11 modules : [],12 allSuites : [],13 matchers : {},14 stubbed : [],15 options : {},16 request : 'XMLHttpRequest' in this ? XMLHttpRequest : null,17 stats : { specs: 0, assertions: 0, failures: 0, passes: 0, specsFinished: 0, suitesFinished: 0 },17 options : { profile: false },1819 /**20 * Default context in which bodies are evaluated.21 *
28 unmodified lines
50 return { an_instance_of : constructor }51 },52 53 /**54 * Load fixture at _path_. This utility function55 * supplies the means to resolve, and cache fixture contents56 * via the DOM or Rhino.54 * Load fixture at _path_.55 *56 * Fixtures are resolved as:57 *58 * - <path>61 * - fixtures/<path>62 * - fixtures/<path>.html59 * - <path>.html60 *61 * @param {string} path62 * @return {string}63 * @api public
1 unmodified line
65 66 fixture : function(path) {67 if (JSpec.cache[path]) return JSpec.cache[path]68 return JSpec.cache[path] = 72 JSpec.tryLoading(path) ||73 JSpec.tryLoading('fixtures/' + path) ||74 JSpec.tryLoading('fixtures/' + path + '.html') ||75 JSpec.tryLoading('spec/' + path) ||76 JSpec.tryLoading('spec/fixtures/' + path) ||77 JSpec.tryLoading('spec/fixtures/' + path + '.html')69 JSpec.tryLoading(JSpec.options.fixturePath + '/' + path) ||70 JSpec.tryLoading(JSpec.options.fixturePath + '/' + path + '.html')71 }72 },7374 // --- Objects75 83 formatters : {76 reporters : {77 78 /**79 * Report to server.80 *
34 unmodified lines
115 if ('close' in main) main.close()116 },117118 /**126 * Default formatter, outputting to the DOM.119 * Default reporter, outputting to the DOM.120 *121 * Options:122 * - reportToId id of element to output reports to, defaults to 'jspec'123 * - failuresOnly displays only suites with failing specs
17 unmodified lines
141 142 report.innerHTML = '<div id="jspec-report" class="' + classes + '"><div class="heading"> \143 <span class="passes">Passes: <em>' + results.stats.passes + '</em></span> \144 <span class="failures">Failures: <em>' + results.stats.failures + '</em></span> \145 <span class="passes">Duration: <em>' + results.duration + '</em> ms</span> \146 </div><table class="suites">' + map(results.allSuites, function(suite) {147 var displaySuite = failuresOnly ? suite.ran && !suite.passed() : suite.ran148 if (displaySuite && suite.hasSpecs())149 return '<tr class="description"><td colspan="2">' + escape(suite.description) + '</td></tr>' +
13 unmodified lines
163 }).join('') + '</table></div>'164 },165 166 /**173 * Terminal formatter.167 * Terminal reporter.168 *169 * @api public170 */171 172 Terminal : function(results, options) {173 failuresOnly = option('failuresOnly')174 print(color("\n Passes: ", 'bold') + color(results.stats.passes, 'green') + 181 color(" Failures: ", 'bold') + color(results.stats.failures, 'red') + "\n")175 color(" Failures: ", 'bold') + color(results.stats.failures, 'red') +176 color(" Duration: ", 'bold') + color(results.duration, 'green') + " ms \n")177 178 function indent(string) {179 return string.replace(/^(.)/gm, ' $1')180 }
21 unmodified lines
202 quit(results.stats.failures)203 },204205 /**211 * Console formatter.206 * Console reporter.207 *208 * @api public209 */210
29 unmodified lines
240 241 // Report assertion results242 243 report : function() {244 if (JSpec.assert) 249 this.passed ? JSpec.stats.passes++ : JSpec.stats.failures++245 this.passed ? JSpec.stats.passes++ : JSpec.stats.failures++246 return this247 },248 249 // Run the assertion
15 unmodified lines
265 266 // Proxy267 268 object[method] = function(){273 args = argumentsToArray(arguments)269 args = toArray(arguments)270 result = old.apply(object, args)271 self.calls.push({ args : args, result : result })272 return result273 }
23 unmodified lines
297 298 // Proxy arguments passed299 300 with_args : function() {305 this.expectedArgs = argumentsToArray(arguments)301 this.expectedArgs = toArray(arguments)302 return this303 },304 305 // Check if any calls have failing results
1 unmodified line
307 anyResultsFail : function() {308 return any(this.calls, function(call){309 return self.expectedResult.an_instance_of ?310 call.result.constructor != self.expectedResult.an_instance_of:315 hash(self.expectedResult) != hash(call.result)311 !equal(self.expectedResult, call.result)312 })313 },314 315 // Check if any calls have passing results
1 unmodified line
317 anyResultsPass : function() {318 return any(this.calls, function(call){319 return self.expectedResult.an_instance_of ?320 call.result.constructor == self.expectedResult.an_instance_of:325 hash(self.expectedResult) == hash(call.result)321 equal(self.expectedResult, call.result)322 })323 },324 325 // Return the passing result
15 unmodified lines
341 return any(self.expectedArgs, function(i, arg){342 if (arg == null) return call.args[i] == null343 return arg.an_instance_of ?344 call.args[i].constructor != arg.an_instance_of:349 hash(arg) != hash(call.args[i])345 !equal(arg, call.args[i])346 347 })348 })349 },
4 unmodified lines
354 return any(this.calls, function(call){355 return any(self.expectedArgs, function(i, arg){356 return arg.an_instance_of ?357 call.args[i].constructor == arg.an_instance_of:362 hash(arg) == hash(call.args[i])358 equal(arg, call.args[i])359 360 })361 })362 },
12 unmodified lines
375 376 // Report assertion results377 378 report : function() {379 if (JSpec.assert) 383 this.passed ? ++JSpec.stats.passes : ++JSpec.stats.failures380 this.passed ? ++JSpec.stats.passes : ++JSpec.stats.failures381 return this382 },383 384 // Run the assertion
117 unmodified lines
502 // Add passing assertion503 504 pass : function(message) {505 this.assertions.push({ passed: true, message: message })509 ++JSpec.stats.passes506 if (JSpec.assert) ++JSpec.stats.passes507 },508 509 // Add failing assertion510 511 fail : function(message) {512 this.assertions.push({ passed: false, message: message })516 ++JSpec.stats.failures513 if (JSpec.assert) ++JSpec.stats.failures514 },515 516 // Run deferred assertions517
157 unmodified lines
675 676 /**677 * Include _object_ which may be a hash or Module instance.678 *682 * @param {has, Module} object679 * @param {hash, Module} object680 * @return {JSpec}681 * @api public682 */683
2 unmodified lines
686 this.modules.push(module)687 if ('init' in module) module.init()688 if ('utilities' in module) extend(this.defaultContext, module.utilities)689 if ('matchers' in module) this.addMatchers(module.matchers)693 if ('formatters' in module) extend(this.formatters, module.formatters)690 if ('reporters' in module) extend(this.reporters, module.reporters)691 if ('DSLs' in module)692 each(module.DSLs, function(name, methods){693 JSpec.DSLs[name] = JSpec.DSLs[name] || {}694 extend(JSpec.DSLs[name], methods)
12 unmodified lines
707 * @api private708 */709 710 hook : function(name, args) {714 args = argumentsToArray(arguments, 1)711 args = toArray(arguments, 1)712 return inject(JSpec.modules, [], function(results, module){713 if (typeof module[name] == 'function')714 results.push(JSpec.evalHook(module, name, args))715 })
85 unmodified lines
801 * @return {array}802 * @api public803 */804 808 argumentsToArray : function(arguments, offset) {805 toArray : function(arguments, offset) {806 return Array.prototype.slice.call(arguments, offset || 0)807 },808 809 /**
28 unmodified lines
838 defaultMatcherMessage : function(actual, expected, negate, name) {839 return 'expected ' + puts(actual) + ' to ' + 840 (negate ? 'not ' : '') + 841 name.replace(/_/g, ' ') +845 ' ' + puts.apply(this, expected.slice(1))842 ' ' + (expected.length > 1 ?843 puts.apply(this, expected.slice(1)) :844 '')845 },846 847 /**848 * Normalize a matcher message.
56 unmodified lines
905 option : function(key) {906 return (value = query(key)) !== null ? value :907 JSpec.options[key] || null908 },909 910 /**911 * Check if object _a_, is equal to object _b_.912 *913 * @param {object} a914 * @param {object} b915 * @return {bool}916 * @api private917 */918 919 equal: function(a, b) {920 if (typeof a != typeof b) return921 if (a === b) return true922 if (a instanceof RegExp)923 return a.toString() === b.toString()924 if (a instanceof Date)925 return Number(a) === Number(b)926 if (typeof a != 'object') return927 if (a.length !== undefined)928 if (a.length !== b.length) return929 else930 for (var i = 0, len = a.length; i < len; ++i)931 if (!equal(a[i], b[i]))932 return933 for (var key in a)934 if (!equal(a[key], b[key]))935 return936 return true937 },938939 /**912 * Generates a hash of the object passed.913 *914 * @param {object} object915 * @return {string}916 * @api private917 */918919 hash : function(object) {920 if (object == null) return 'null'921 if (object == undefined) return 'undefined'922 function serialize(prefix) {923 return inject(object, prefix + ':', function(buffer, key, value){924 return buffer += hash(value)925 })926 }927 switch (object.constructor) {928 case Array : return serialize('a')929 case RegExp: return 'r:' + object.toString()930 case Number: return 'n:' + object.toString()931 case String: return 's:' + object.toString()932 case Object: return 'o:' + inject(object, [], function(array, key, value){933 array.push([key, hash(value)])934 }).sort()935 default: return object.toString()936 }937 },938939 /**940 * Return last element of an array.941 *942 * @param {array} array943 * @return {object}
12 unmodified lines
956 * @api public957 */958959 puts : function(object) {960 if (arguments.length > 1) {961 return map(argumentsToArray(arguments), function(arg){960 if (arguments.length > 1)961 return map(toArray(arguments), function(arg){962 return puts(arg)963 }).join(', ')964 }965 if (object === undefined) return ''964 if (object === undefined) return 'undefined'965 if (object === null) return 'null'966 if (object === true) return 'true'967 if (object === false) return 'false'968 if (object.an_instance_of) return 'an instance of ' + object.an_instance_of.name970 if (object.jquery && object.selector.length > 0) return 'selector ' + puts(object.selector) + ''969 if (object.jquery && object.selector.length > 0) return 'selector ' + puts(object.selector)970 if (object.jquery) return object.get(0).outerHTML971 if (object.nodeName) return object.outerHTML972 switch (object.constructor) {974 case String: return "'" + object + "'"975 case Number: return object973 case Function: return object.name || object 974 case String: 975 return '"' + object976 .replace(/"/g, '\\"')977 .replace(/\n/g, '\\n')978 .replace(/\t/g, '\\t')979 + '"'980 case Array: 981 return inject(object, '[', function(b, v){982 return b + ', ' + puts(v)983 }).replace('[,', '[') + ' ]'984 case Object:985 object.__hit__ = true986 return inject(object, '{', function(b, k, v) {983 return b + ', ' + puts(k) + ' : ' + puts(v)987 if (k == '__hit__') return b988 return b + ', ' + k + ': ' + (v && v.__hit__ ? '<circular reference>' : puts(v))989 }).replace('{,', '{') + ' }'990 default: 991 return object.toString()992 }
35 unmodified lines
1028 * @api private1029 */1030 1031 does : function(actual, matcher, expected) {1027 var assertion = new JSpec.Assertion(JSpec.matchers[matcher], actual, argumentsToArray(arguments, 2))1032 var assertion = new JSpec.Assertion(JSpec.matchers[matcher], actual, toArray(arguments, 2))1033 return assertion.run().result1034 },10351036 /**
9 unmodified lines
1046 */10471048 expect : function(actual) {1049 assert = function(matcher, args, negate) {1045 var expected = argumentsToArray(args, 1)1050 var expected = toArray(args, 1)1051 matcher.negate = negate 1052 assertion = new JSpec.Assertion(matcher, actual, expected, negate)1053 hook('beforeAssertion', assertion)1054 if (matcher.defer) assertion.run()
63 unmodified lines
1118 1119 /**1120 * Iterate an object, invoking the given callback.1121 *1117 * @param {hash, array, string} object1122 * @param {hash, array} object1123 * @param {function} callback1124 * @return {JSpec}1125 * @api public1126 */11271128 each : function(object, callback) {1129 if (object.constructor == Array)1130 for (var i = 0, len = object.length; i < len; ++i)1131 callIterator(callback, i, object[i])1124 if (typeof object == 'string') object = object.split(' ')1125 for (key in object) 1126 if (object.hasOwnProperty(key))1127 callIterator(callback, key, object[key])1132 else1133 for (var key in object) 1134 if (object.hasOwnProperty(key))1135 callIterator(callback, key, object[key])1136 },11371138 /**1139 * Iterate with memo.
193 unmodified lines
1333 var matchers = this.matchers1334 var context = this.context || this.defaultContext1335 var contents = this.contentsOf(body)1336 hook('evaluatingBody', dsl, matchers, context, contents)1329 try { eval('with (dsl){ with (context) { with (matchers) { ' + contents + ' }}}') }1337 try { with (dsl){ with (context) { with (matchers) { eval(contents) }}} }1338 catch(e) { error(errorMessage, e) }1339 },13401341 /**
9 unmodified lines
1351 input = hookImmutable('preprocessing', input)1352 return input.1353 replace(/\t/g, ' ').1354 replace(/\r\n|\n|\r/g, '\n').1347 replace(/__END__[^]*/, '').1355 split('__END__')[0].1356 replace(/([\w\.]+)\.(stub|destub)\((.*?)\)$/gm, '$2($1, $3)').1357 replace(/describe\s+(.*?)$/gm, 'describe($1, function(){').1358 replace(/^\s+it\s+(.*?)$/gm, ' it($1, function(){').1359 replace(/^ *(before_each|after_each|before|after)(?= |\n|$)/gm, 'JSpec.currentSuite.addHook("$1", function(){').
28 unmodified lines
1388 * @api public1389 */13901391 report : function() {1392 this.duration = Number(new Date) - this.start1393 hook('reporting', JSpec.options)1385 new (JSpec.options.formatter || JSpec.formatters.DOM)(JSpec, JSpec.options)1394 new (JSpec.options.reporter || JSpec.reporters.DOM)(JSpec, JSpec.options)1395 },13961397 /**1398 * Run the spec suites. Options are merged
6 unmodified lines
14051406 run : function(options) {1407 if (any(hook('running'), haveStopped)) return this1408 if (options) extend(this.options, options)1400 if (option('profile')) console.group('Profile')1409 this.start = Number(new Date)1410 each(this.suites, function(suite) { JSpec.runSuite(suite) })1402 if (option('profile')) console.groupEnd()1411 return this1412 },1413 1414 /**
54 unmodified lines
1469 */14701471 runSpec : function(spec) {1472 this.currentSpec = spec1465 if (option('profile')) console.time(spec.description)1473 try { this.evalBody(spec.body) }1474 catch (e) { fail(e) }1468 if (option('profile')) console.timeEnd(spec.description)1475 spec.runDeferredAssertions()1476 destub()1477 this.stats.specsFinished++1478 this.stats.assertions += spec.assertions.length
114 unmodified lines
1593 * @api public1594 */1595 1596 tryLoading : function(file) {1591 try { return JSpec.load(file) }1592 catch (e) {}1597 try { return JSpec.load(file) } catch (e) {}1598 },15991600 /**1601 * Load a _file_'s contents.
40 unmodified lines
16421643 var main = this1644 var find = JSpec.any1645 var utils = 'haveStopped stub hookImmutable hook destub map any last pass fail range each option inject select \1641 error escape extend puts hash query strip color does addMatchers callIterator argumentsToArray'.split(/\s+/)1642 while (utils.length) util = utils.shift(), eval('var ' + util + ' = JSpec.' + util)1646 error escape extend puts query strip color does addMatchers callIterator toArray equal'.split(/\s+/)1647 while (utils.length) eval('var ' + utils[0] + ' = JSpec.' + utils.shift())1648 if (!main.setTimeout) main.setTimeout = function(callback){ callback() }16491650 // --- Matchers16511652 addMatchers({1653 equal : "===",1654 eql : "equal(actual, expected)",1655 be : "alias equal",1656 be_greater_than : ">",1657 be_less_than : "<",1658 be_at_least : ">=",
10 unmodified lines
1669 respond_to : "typeof actual[expected] == 'function'",1670 have_length : "actual.length == expected",1671 be_within : "actual >= expected[0] && actual <= last(expected)",1672 have_length_within : "actual.length >= expected[0] && actual.length <= last(expected)",16671668 eql : function(actual, expected) {1669 return actual.constructor == Array ||1670 actual instanceof Object ? 1671 hash(actual) == hash(expected):1672 actual == expected1673 },1673 1674 receive : { defer : true, match : function(actual, method, times) {1675 proxy = new JSpec.ProxyAssertion(actual, method, times, this.negate)1676 JSpec.currentSpec.assertions.push(proxy)
22 unmodified lines
1699 state = arg in actual1700 break1701 1702 case Array: 1704 state = any(actual, function(value){ return hash(value) == hash(arg) })1703 state = any(actual, function(value){ return equal(value, arg) })1704 break1705 }1706 if (!state) return false1707 }
5 unmodified lines
1713 catch (e) {1714 this.e = e1715 var assert = function(arg) {1716 switch (arg.constructor) {1718 case RegExp : return arg.test(e)1717 case RegExp : return arg.test(e.message || e.toString())1718 case String : return arg == (e.message || e.toString())1720 case Function : return (e.name || 'Error') == arg.name1719 case Function : return e instanceof arg || e.name == arg.name1720 }1721 }1722 return message ? assert(expected) && assert(message) :1723 expected ? assert(expected) :
45 unmodified lines
1769 value === actual[property]1770 }1771 })1772 1774 if ('exports' in main) exports.JSpec = JSpec17751773})()
modified:spec/lib/jspec.shell.js+5 added-2 removed
modified:spec/lib/jspec.timers.js+1 added-1 removed
12// Mock Timers - Copyright TJ Holowaychuk <tj@vision-media.ca> (MIT Licensed)2// JSpec - Mock Timers - Copyright TJ Holowaychuk <tj@vision-media.ca> (MIT Licensed)34;(function(){5 6 /**
84 unmodified lines
modified:spec/lib/jspec.xhr.js+12 added-2 removed
6 unmodified lines
7 8 var OriginalXMLHttpRequest = 'XMLHttpRequest' in this ? 9 XMLHttpRequest :10 function(){}11 var OriginalActiveXObject = 'ActiveXObject' in this ?12 ActiveXObject :13 undefined1114 15 // --- MockXMLHttpRequest1617 var MockXMLHttpRequest = function() {18 this.requestHeaders = {}
49 unmodified lines
68 * Send request _data_.69 */7071 send : function(data) {72 var self = this73 this.data = data74 this.readyState = 475 if (this.method == 'HEAD') this.responseText = null76 this.responseHeaders['content-length'] = (this.responseText || '').length77 if(this.async) this.onreadystatechange()78 lastRequest = function(){79 return self80 }81 }82 }83 84 // --- Response status codes
53 unmodified lines
138 139 function mockRequest() {140 return { and_return : function(body, type, status, headers) {141 XMLHttpRequest = MockXMLHttpRequest142 ActiveXObject = false143 status = status || 200144 headers = headers || {}145 headers['content-type'] = type146 JSpec.extend(XMLHttpRequest.prototype, {
12 unmodified lines
159 */160 161 function unmockRequest() {162 XMLHttpRequest = OriginalXMLHttpRequest163 ActiveXObject = OriginalActiveXObject164 }165 166 JSpec.include({167 name: 'Mock XHR',
15 unmodified lines
183 184 DSLs : {185 snake : {186 mock_request: mockRequest,178 unmock_request: unmockRequest187 unmock_request: unmockRequest,188 last_request: function(){ return lastRequest() }189 }190 }191192 })
1 unmodified line
added:spec/support/libxmljsnot shown

Its text is not shown, added.

deleted:spec/support/libxmljs.nodebinary

A binary file, deleted.

added:spec/node.js+42 added
12require.paths.unshift('spec', 'lib', 'spec/lib', 'spec/support/libxmljs')3require("jspec")4require("express")5require("express/spec")67quit = process.exit8print = puts910readFile = function(path) {11 var result12 require('posix')13 .cat(path, "utf8")14 .addCallback(function(contents){ result = contents })15 .addErrback(function(){ throw new Error("failed to read file `" + path + "'") })16 .wait()17 return result18}1920if (process.ARGV[2])21 JSpec.exec('spec/spec.' + process.ARGV[2] + '.js') 22else23 JSpec24 .exec('spec/spec.core.js')25 .exec('spec/spec.routing.js')26 .exec('spec/spec.helpers.js')27 .exec('spec/spec.request.js')28 .exec('spec/spec.mime.js')29 .exec('spec/spec.static.js')30 .exec('spec/spec.collection.js')31 .exec('spec/spec.element-collection.js')32 .exec('spec/spec.plugins.js')33 .exec('spec/spec.plugins.view.js')34 .exec('spec/spec.plugins.common-logger.js')35 .exec('spec/spec.plugins.content-length.js')36 .exec('spec/spec.plugins.method-override.js')37 .exec('spec/spec.plugins.body-decoder.js')38 .exec('spec/spec.plugins.redirect.js')39 .exec('spec/spec.plugins.hooks.js')40 .exec('spec/spec.plugins.cookie.js')41JSpec.run({ reporter: JSpec.reporters.Terminal, failuresOnly: true })42JSpec.report()
modified:spec/spec.collection.js+1 added-1 removed
281 unmodified lines
282 end283 284 describe '#toArray()'285 it 'should return an array'286 $(['foo', 'bar']).keys().toArray().should.eql [0, 1]286 $(['foo', 'bar']).keys().toArray().should.eql ['0', '1']287 end288 289 it 'should work on nested collections'290 $([$(['foo']), $(['bar'])]).toArray().should.eql [['foo'], ['bar']]
182 unmodified lines
deleted:spec/spec.node.js-43 removed
12require.paths.unshift('spec', 'spec/lib', 'lib')3require("jspec")4require("express")5require("express/spec")67quit = process.exit8print = puts910readFile = function(path) {11 var promise = require('posix').cat(path, "utf8")12 var result = ''13 promise.addErrback(function(){ throw "failed to read file `" + path + "'" })14 promise.addCallback(function(contents){15 result = contents16 })17 promise.wait()18 return result19}2021if (process.ARGV[2])22 JSpec.exec('spec/spec.' + process.ARGV[2] + '.js') 23else24 JSpec25 .exec('spec/spec.core.js')26 .exec('spec/spec.routing.js')27 .exec('spec/spec.helpers.js')28 .exec('spec/spec.request.js')29 .exec('spec/spec.mime.js')30 .exec('spec/spec.static.js')31 .exec('spec/spec.collection.js')32 .exec('spec/spec.element-collection.js')33 .exec('spec/spec.plugins.js')34 .exec('spec/spec.plugins.view.js')35 .exec('spec/spec.plugins.common-logger.js')36 .exec('spec/spec.plugins.content-length.js')37 .exec('spec/spec.plugins.method-override.js')38 .exec('spec/spec.plugins.body-decoder.js')39 .exec('spec/spec.plugins.redirect.js')40 .exec('spec/spec.plugins.hooks.js')41 .exec('spec/spec.plugins.cookie.js')42JSpec.run({ formatter: JSpec.formatters.Terminal, failuresOnly: true })43JSpec.report()
modified:Makefile+5 added-2 removed
12NODE = node34test:5 @$(NODE) spec/spec.node.js4test: spec/support/libxmljs/libxmljs.node5 @$(NODE) spec/node.js6 7app:8 @$(NODE) examples/app.js9 10benchmark:11 @$(NODE) benchmarks/collection.js12 13spec/support/libxmljs/libxmljs.node:14 @scons -C spec/support/libxmljs libxmljs.node15 16.PHONY: test benchmark app
modified:Readme.md+6 added-3 removed
86 unmodified lines
87 $ make test88 89Run individual suites:9091 $ node spec/spec.node.js core92 $ node spec/spec.node.js mime93 $ node spec/spec.node.js routing91 $ node spec/node.js core92 $ node spec/node.js mime93 $ node spec/node.js routing94 ...95 96Runnning libxmljs related specs, if you have an architecture issue97then you will need to rebuild _spec/support/libxmljs.node_.9899Express is currently being developed with node --version:100 v0.1.21-66-g59a78d6101
35 unmodified lines