lib/jspec.js in jspec-2.11.7 vs lib/jspec.js in jspec-2.11.8
- old
+ new
@@ -3,11 +3,11 @@
(function(){
JSpec = {
- version : '2.11.7',
+ version : '2.11.8',
cache : {},
suites : [],
modules : [],
allSuites : [],
matchers : {},
@@ -1336,14 +1336,15 @@
preprocess : function(input) {
if (typeof input != 'string') return
input = hookImmutable('preprocessing', input)
return input.
- replace(/\r\n/gm, '\n').
+ replace(/\t/gm, ' ').
+ replace(/\r\n|\n|\r/gm, '\n').
replace(/([\w\.]+)\.(stub|destub)\((.*?)\)$/gm, '$2($1, $3)').
replace(/describe\s+(.*?)$/gm, 'describe($1, function(){').
replace(/^\s+it\s+(.*?)$/gm, ' it($1, function(){').
- replace(/^\s*(before_each|after_each|before|after)(?=\s|$)/gm, 'JSpec.currentSuite.addHook("$1", function(){').
+ replace(/^ *(before_each|after_each|before|after)(?= |\n|$)/gm, 'JSpec.currentSuite.addHook("$1", function(){').
replace(/^\s*end(?=\s|$)/gm, '});').
replace(/-\{/g, 'function(){').
replace(/(\d+)\.\.(\d+)/g, function(_, a, b){ return range(a, b) }).
replace(/\.should([_\.]not)?[_\.](\w+)(?: |;|$)(.*)$/gm, '.should$1_$2($3)').
replace(/([\/\s]*)(.+?)\.(should(?:[_\.]not)?)[_\.](\w+)\((.*)\)\s*;?$/gm, '$1 expect($2).$3($4, $5)').
\ No newline at end of file