o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1362090444.394185: @value"§¾{I" class:EFI"BundledAsset;FI"logical_path;FI"mocha/mocha.js;TI" pathname;FI"0$root/app/assets/javascripts/mocha/mocha.js;FI"content_type;FI"application/javascript;FI" mtime;FI"2013-02-18T08:12:30+08:00;FI" length;Fiø¼I" digest;F"%a07f05d146c377e0086de1822c9f6de1I" source;FI"ø¼(function(){function e(t){var n=e.resolve(t),r=e.modules[n];if(!r)throw new Error('failed to require "'+t+'"');return r.exports||(r.exports={},r.call(r.exports,r,r.exports,e.relative(n))),r.exports}e.modules={},e.resolve=function(t){var n=t,r=t+".js",i=t+"/index.js";return e.modules[r]&&r||e.modules[i]&&i||n},e.register=function(t,n){e.modules[t]=n},e.relative=function(t){return function(n){if("."!=n.charAt(0))return e(n);var r=t.split("/"),i=n.split("/");r.pop();for(var s=0;s/g,">"),t=t.replace(/"/g,"""),t}var r=function(e){this.ignoreWhitespace=e};r.prototype={diff:function(t,n){if(n==t)return[{value:n}];if(!n)return[{value:t,removed:!0}];if(!t)return[{value:n,added:!0}];n=this.tokenize(n),t=this.tokenize(t);var r=n.length,i=t.length,s=r+i,o=[{newPos:-1,components:[]}],u=this.extractCommon(o[0],n,t,0);if(o[0].newPos+1>=r&&u+1>=i)return o[0].components;for(var a=1;a<=s;a++)for(var f=-1*a;f<=a;f+=2){var l,c=o[f-1],h=o[f+1];u=(h?h.newPos:0)-f,c&&(o[f-1]=undefined);var p=c&&c.newPos+1=r&&u+1>=i)return l.components;o[f]=l}},pushComponent:function(e,t,n,r){var i=e[e.length-1];i&&i.added===n&&i.removed===r?e[e.length-1]={value:this.join(i.value,t),added:n,removed:r}:e.push({value:t,added:n,removed:r})},extractCommon:function(e,t,n,r){var i=t.length,s=n.length,o=e.newPos,u=o-r;while(o+1"):i.removed&&t.push(""),t.push(n(i.value)),i.added?t.push(""):i.removed&&t.push("")}return t.join("")}}}();typeof e!="undefined"&&(e.exports=r)}),e.register("browser/events.js",function(e,t,n){function r(e){return"[object Array]"=={}.toString.call(e)}function i(){}t.EventEmitter=i,i.prototype.on=function(e,t){return this.$events||(this.$events={}),this.$events[e]?r(this.$events[e])?this.$events[e].push(t):this.$events[e]=[this.$events[e],t]:this.$events[e]=t,this},i.prototype.addListener=i.prototype.on,i.prototype.once=function(e,t){function r(){n.removeListener(e,r),t.apply(this,arguments)}var n=this;return r.listener=t,this.on(e,r),this},i.prototype.removeListener=function(e,t){if(this.$events&&this.$events[e]){var n=this.$events[e];if(r(n)){var i=-1;for(var s=0,o=n.length;s1&&t.shift();var n=r.create(t[0],e);t.unshift(n)},e.test=function(e,n){t[0].addTest(new i(e,n))}})}}),e.register("interfaces/tdd.js",function(e,t,n){var r=n("../suite"),i=n("../test");e.exports=function(e){var t=[e];e.on("pre-require",function(e,n,s){e.setup=function(e){t[0].beforeEach(e)},e.teardown=function(e){t[0].afterEach(e)},e.suiteSetup=function(e){t[0].beforeAll(e)},e.suiteTeardown=function(e){t[0].afterAll(e)},e.suite=function(e,n){var i=r.create(t[0],e);return t.unshift(i),n.call(i),t.shift(),i},e.suite.only=function(t,n){var r=e.suite(t,n);s.grep(r.fullTitle())},e.test=function(e,n){var r=new i(e,n);return t[0].addTest(r),r},e.test.only=function(t,n){var r=e.test(t,n);s.grep(r.fullTitle())},e.test.skip=function(t){e.test(t)}})}}),e.register("mocha.js",function(e,t,n){function s(e){return __dirname+"/../images/"+e+".png"}function o(e){e=e||{},this.files=[],this.options=e,this.grep(e.grep),this.suite=new t.Suite("",new t.Context),this.ui(e.ui),this.bail(e.bail),this.reporter(e.reporter),e.timeout&&this.timeout(e.timeout),e.slow&&this.slow(e.slow)}var r=n("browser/path"),i=n("./utils");t=e.exports=o,t.utils=i,t.interfaces=n("./interfaces"),t.reporters=n("./reporters"),t.Runnable=n("./runnable"),t.Context=n("./context"),t.Runner=n("./runner"),t.Suite=n("./suite"),t.Hook=n("./hook"),t.Test=n("./test"),o.prototype.bail=function(e){return 0==arguments.length&&(e=!0),this.suite.bail(e),this},o.prototype.addFile=function(e){return this.files.push(e),this},o.prototype.reporter=function(e){if("function"==typeof e)this._reporter=e;else{e=e||"dot";try{this._reporter=n("./reporters/"+e)}catch(t){this._reporter=n(e)}if(!this._reporter)throw new Error('invalid reporter "'+e+'"')}return this},o.prototype.ui=function(e){e=e||"bdd",this._ui=t.interfaces[e];if(!this._ui)throw new Error('invalid interface "'+e+'"');return this._ui=this._ui(this.suite),this},o.prototype.loadFiles=function(e){var t=this,i=this.suite,s=this.files.length;this.files.forEach(function(o){o=r.resolve(o),i.emit("pre-require",global,o,t),i.emit("require",n(o),o,t),i.emit("post-require",global,o,t),--s||e&&e()})},o.prototype._growl=function(e,t){var r=n("growl");e.on("end",function(){var n=t.stats;if(n.failures){var i=n.failures+" of "+e.total+" tests failed";r(i,{name:"mocha",title:"Failed",image:s("error")})}else r(n.passes+" tests passed in "+n.duration+"ms",{name:"mocha",title:"Passed",image:s("ok")})})},o.prototype.grep=function(e){return this.options.grep="string"==typeof e?new RegExp(i.escapeRegexp(e)):e,this},o.prototype.invert=function(){return this.options.invert=!0,this},o.prototype.ignoreLeaks=function(){return this.options.ignoreLeaks=!0,this},o.prototype.checkLeaks=function(){return this.options.ignoreLeaks=!1,this},o.prototype.growl=function(){return this.options.growl=!0,this},o.prototype.globals=function(e){return this.options.globals=(this.options.globals||[]).concat(e),this},o.prototype.timeout=function(e){return this.suite.timeout(e),this},o.prototype.slow=function(e){return this.suite.slow(e),this},o.prototype.asyncOnly=function(){return this.options.asyncOnly=!0,this},o.prototype.run=function(e){this.files.length&&this.loadFiles();var n=this.suite,r=this.options,i=new t.Runner(n),s=new this._reporter(i);return i.ignoreLeaks=r.ignoreLeaks,i.asyncOnly=r.asyncOnly,r.grep&&i.grep(r.grep,r.invert),r.globals&&i.globals(r.globals),r.growl&&this._growl(i,s),i.run(e)}}),e.register("ms.js",function(e,t,n){function u(e){var t=/^((?:\d+)?\.?\d+) *(ms|seconds?|s|minutes?|m|hours?|h|days?|d|years?|y)?$/i.exec(e);if(!t)return;var n=parseFloat(t[1]),r=(t[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"y":return n*315576e5;case"days":case"day":case"d":return n*864e5;case"hours":case"hour":case"h":return n*36e5;case"minutes":case"minute":case"m":return n*6e4;case"seconds":case"second":case"s":return n*1e3;case"ms":return n}}function a(e){return e==o?Math.round(e/o)+" day":e>o?Math.round(e/o)+" days":e==s?Math.round(e/s)+" hour":e>s?Math.round(e/s)+" hours":e==i?Math.round(e/i)+" minute":e>i?Math.round(e/i)+" minutes":e==r?Math.round(e/r)+" second":e>r?Math.round(e/r)+" seconds":e+" ms"}var r=1e3,i=r*60,s=i*60,o=s*24;e.exports=function(e){return"string"==typeof e?u(e):a(e)}}),e.register("reporters/base.js",function(e,t,n){function p(e){var t=this,n=this.stats={suites:0,tests:0,passes:0,pending:0,failures:0},r=this.failures=[];if(!e)return;this.runner=e,e.stats=n,e.on("start",function(){n.start=new o}),e.on("suite",function(e){n.suites=n.suites||0,e.root||n.suites++}),e.on("test end",function(e){n.tests=n.tests||0,n.tests++}),e.on("pass",function(e){n.passes=n.passes||0;var t=e.slow()/2;e.speed=e.duration>e.slow()?"slow":e.duration>t?"medium":"fast",n.passes++}),e.on("fail",function(e,t){n.failures=n.failures||0,n.failures++,e.err=t,r.push(e)}),e.on("end",function(){n.end=new o,n.duration=new o-n.start}),e.on("pending",function(){n.pending++})}function d(e,t){return e=String(e),Array(t-e.length+1).join(" ")+e}function v(e,t,n){return i["diff"+t](e.actual,e.expected).map(function(e){return n&&(e.value=e.value.replace(/\t/g,"").replace(/\r/g,"").replace(/\n/g,"\n")),e.added?m("diff added",e.value):e.removed?m("diff removed",e.value):e.value}).join("")}function m(e,t){return t.split("\n").map(function(t){return h(e,t)}).join("\n")}var r=n("browser/tty"),i=n("browser/diff"),s=n("../ms"),o=global.Date,u=global.setTimeout,a=global.setInterval,f=global.clearTimeout,l=global.clearInterval,c=r.isatty(1)&&r.isatty(2);t=e.exports=p,t.useColors=c,t.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:0,"error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90,"diff gutter":90,"diff added":42,"diff removed":41},t.symbols={ok:"✓",err:"✖",dot:"․"},"win32"==process.platform&&(t.symbols.ok="√",t.symbols.err="×",t.symbols.dot=".");var h=t.color=function(e,n){return t.useColors?"["+t.colors[e]+"m"+n+"":n};t.window={width:c?process.stdout.getWindowSize?process.stdout.getWindowSize(1)[0]:r.getWindowSize()[1]:75},t.cursor={hide:function(){process.stdout.write("[?25l")},show:function(){process.stdout.write("[?25h")},deleteLine:function(){process.stdout.write("")},beginningOfLine:function(){process.stdout.write("")},CR:function(){t.cursor.deleteLine(),t.cursor.beginningOfLine()}},t.list=function(e){console.error(),e.forEach(function(e,t){var n=h("error title"," %s) %s:\n")+h("error message"," %s")+h("error stack","\n%s\n"),r=e.err,i=r.message||"",s=r.stack||i,o=s.indexOf(i)+i.length,u=s.slice(0,o),a=r.actual,f=r.expected,l=!0;r.showDiff&&(l=!1,r.actual=a=JSON.stringify(a,null,2),r.expected=f=JSON.stringify(f,null,2));if("string"==typeof a&&"string"==typeof f){var c=Math.max(a.length,f.length);c<20?u=v(r,"Chars",l):u=v(r,"Words",l);var p=u.split("\n");if(p.length>4){var m=String(p.length).length;u=p.map(function(e,t){return d(++t,m)+" |"+" "+e}).join("\n")}u="\n"+h("diff removed","actual")+" "+h("diff added","expected")+"\n\n"+u+"\n",u=u.replace(/^/gm," "),n=h("error title"," %s) %s:\n%s")+h("error stack","\n%s\n")}s=s.slice(o?o+1:o).replace(/^/gm," "),console.error(n,t+1,e.fullTitle(),u,s)})},p.prototype.epilogue=function(){function i(e){return 1==e?"test":"tests"}var e=this.stats,n,r;console.log();if(e.failures){n=h("bright fail"," "+t.symbols.err)+h("fail"," %d of %d %s failed")+h("light",":"),console.error(n,e.failures,this.runner.total,i(this.runner.total)),p.list(this.failures),console.error();return}n=h("bright pass"," ")+h("green"," %d %s complete")+h("light"," (%s)"),console.log(n,e.tests||0,i(e.tests),s(e.duration)),e.pending&&(n=h("pending"," ")+h("pending"," %d %s pending"),console.log(n,e.pending,i(e.pending))),console.log()}}),e.register("reporters/doc.js",function(e,t,n){function s(e){function u(){return Array(o).join(" ")}r.call(this,e);var t=this,n=this.stats,s=e.total,o=2;e.on("suite",function(e){if(e.root)return;++o,console.log('%s
',u()),++o,console.log("%s

%s

",u(),i.escape(e.title)),console.log("%s
",u())}),e.on("suite end",function(e){if(e.root)return;console.log("%s
",u()),--o,console.log("%s
",u()),--o}),e.on("pass",function(e){console.log("%s
%s
",u(),i.escape(e.title));var t=i.escape(i.clean(e.fn.toString()));console.log("%s
%s
",u(),t)})}var r=n("./base"),i=n("../utils");t=e.exports=s}),e.register("reporters/dot.js",function(e,t,n){function s(e){r.call(this,e);var t=this,n=this.stats,s=r.window.width*.75|0,o=0;e.on("start",function(){process.stdout.write("\n ")}),e.on("pending",function(e){process.stdout.write(i("pending",r.symbols.dot))}),e.on("pass",function(e){++o%s==0&&process.stdout.write("\n "),"slow"==e.speed?process.stdout.write(i("bright yellow",r.symbols.dot)):process.stdout.write(i(e.speed,r.symbols.dot))}),e.on("fail",function(e,t){++o%s==0&&process.stdout.write("\n "),process.stdout.write(i("fail",r.symbols.dot))}),e.on("end",function(){console.log(),t.epilogue()})}function o(){}var r=n("./base"),i=r.color;t=e.exports=s,o.prototype=r.prototype,s.prototype=new o,s.prototype.constructor=s}),e.register("reporters/html-cov.js",function(e,t,n){function s(e){var t=n("jade"),s=__dirname+"/templates/coverage.jade",u=i.readFileSync(s,"utf8"),a=t.compile(u,{filename:s}),f=this;r.call(this,e,!1),e.on("end",function(){process.stdout.write(a({cov:f.cov,coverageClass:o}))})}function o(e){return e>=75?"high":e>=50?"medium":e>=25?"low":"terrible"}var r=n("./json-cov"),i=n("browser/fs");t=e.exports=s}),e.register("reporters/html.js",function(e,t,n){function p(e,t){r.call(this,e);var n=this,a=this.stats,f=e.total,l=v(h),c=l.getElementsByTagName("li"),p=c[1].getElementsByTagName("em")[0],w=c[1].getElementsByTagName("a")[0],E=c[2].getElementsByTagName("em")[0],S=c[2].getElementsByTagName("a")[0],x=c[3].getElementsByTagName("em")[0],T=l.getElementsByTagName("canvas")[0],N=v('
    '),C=[N],k,L;t=t||document.getElementById("mocha");if(T.getContext){var A=window.devicePixelRatio||1;T.style.width=T.width,T.style.height=T.height,T.width*=A,T.height*=A,L=T.getContext("2d"),L.scale(A,A),k=new s}if(!t)return d("#mocha div missing, add it to your document");b(w,"click",function(){g();var e=/pass/.test(N.className)?"":" pass";N.className=N.className.replace(/fail|pass/g,"")+e,N.className.trim()&&m("test pass")}),b(S,"click",function(){g();var e=/fail/.test(N.className)?"":" fail";N.className=N.className.replace(/fail|pass/g,"")+e,N.className.trim()&&m("test fail")}),t.appendChild(l),t.appendChild(N),k&&k.size(40),e.on("suite",function(e){if(e.root)return;var t="?grep="+encodeURIComponent(e.fullTitle()),n=v('
  • %s

  • ',t,o(e.title));C[0].appendChild(n),C.unshift(document.createElement("ul")),n.appendChild(C[0])}),e.on("suite end",function(e){if(e.root)return;C.shift()}),e.on("fail",function(t,n){"hook"==t.type&&e.emit("test end",t)}),e.on("test end",function(e){window.scrollTo(0,document.body.scrollHeight);var t=a.tests/this.total*100|0;k&&k.update(t).draw(L);var n=new u-a.start;y(p,a.passes),y(E,a.failures),y(x,(n/1e3).toFixed(2));if("passed"==e.state)var r=v('
  • %e%ems ‣

  • ',e.speed,e.title,e.duration,encodeURIComponent(e.fullTitle()));else if(e.pending)var r=v('
  • %e

  • ',e.title);else{var r=v('
  • %e ‣

  • ',e.title,encodeURIComponent(e.fullTitle())),s=e.err.stack||e.err.toString();~s.indexOf(e.err.message)||(s=e.err.message+"\n"+s),"[object Error]"==s&&(s=e.err.message),!e.err.stack&&e.err.sourceURL&&e.err.line!==undefined&&(s+="\n("+e.err.sourceURL+":"+e.err.line+")"),r.appendChild(v('
    %e
    ',s))}if(!e.pending){var o=r.getElementsByTagName("h2")[0];b(o,"click",function(){f.style.display="none"==f.style.display?"block":"none"});var f=v("
    %e
    ",i.clean(e.fn.toString()));r.appendChild(f),f.style.display="none"}C[0]&&C[0].appendChild(r)})}function d(e){document.body.appendChild(v('
    %s
    ',e))}function v(e){var t=arguments,n=document.createElement("div"),r=1;return n.innerHTML=e.replace(/%([se])/g,function(e,n){switch(n){case"s":return String(t[r++]);case"e":return o(t[r++])}}),n.firstChild}function m(e){var t=document.getElementsByClassName("suite");for(var n=0;n0&&(t.coverage=t.hits/t.sloc*100),t}function o(e,t){var n={filename:e,coverage:0,hits:0,misses:0,sloc:0,source:{}};return t.source.forEach(function(e,r){r++,t[r]===0?(n.misses++,n.sloc++):t[r]!==undefined&&(n.hits++,n.sloc++),n.source[r]={source:e,coverage:t[r]===undefined?"":t[r]}}),n.coverage=n.hits/n.sloc*100,n}function u(e){return{title:e.title,fullTitle:e.fullTitle(),duration:e.duration}}var r=n("./base");t=e.exports=i}),e.register("reporters/json-stream.js",function(e,t,n){function s(e){r.call(this,e);var t=this,n=this.stats,i=e.total;e.on("start",function(){console.log(JSON.stringify(["start",{total:i}]))}),e.on("pass",function(e){console.log(JSON.stringify(["pass",o(e)]))}),e.on("fail",function(e,t){console.log(JSON.stringify(["fail",o(e)]))}),e.on("end",function(){process.stdout.write(JSON.stringify(["end",t.stats]))})}function o(e){return{title:e.title,fullTitle:e.fullTitle(),duration:e.duration}}var r=n("./base"),i=r.color;t=e.exports=s}),e.register("reporters/json.js",function(e,t,n){function o(e){var t=this;r.call(this,e);var n=[],i=[],s=[];e.on("test end",function(e){n.push(e)}),e.on("pass",function(e){s.push(e)}),e.on("fail",function(e){i.push(e)}),e.on("end",function(){var e={stats:t.stats,tests:n.map(u),failures:i.map(u),passes:s.map(u)};process.stdout.write(JSON.stringify(e,null,2))})}function u(e){return{title:e.title,fullTitle:e.fullTitle(),duration:e.duration}}var r=n("./base"),i=r.cursor,s=r.color;t=e.exports=o}),e.register("reporters/landing.js",function(e,t,n){function o(e){function h(){var e=Array(o).join("-");return" "+s("runway",e)}r.call(this,e);var t=this,n=this.stats,o=r.window.width*.75|0,u=e.total,a=process.stdout,f=s("plane","✈"),l=-1,c=0;e.on("start",function(){a.write("\n "),i.hide()}),e.on("test end",function(e){var t=-1==l?o*++c/u|0:l;"failed"==e.state&&(f=s("plane crash","✈"),l=t),a.write("\n\n"),a.write(h()),a.write("\n "),a.write(s("runway",Array(t).join("⋅"))),a.write(f),a.write(s("runway",Array(o-t).join("⋅")+"\n")),a.write(h()),a.write("")}),e.on("end",function(){i.show(),console.log(),t.epilogue()})}function u(){}var r=n("./base"),i=r.cursor,s=r.color;t=e.exports=o,r.colors.plane=0,r.colors["plane crash"]=31,r.colors.runway=90,u.prototype=r.prototype,o.prototype=new u,o.prototype.constructor=o}),e.register("reporters/list.js",function(e,t,n){function o(e){r.call(this,e);var t=this,n=this.stats,o=0;e.on("start",function(){console.log()}),e.on("test",function(e){process.stdout.write(s("pass"," "+e.fullTitle()+": "))}),e.on("pending",function(e){var t=s("checkmark"," -")+s("pending"," %s");console.log(t,e.fullTitle())}),e.on("pass",function(e){var t=s("checkmark"," "+r.symbols.dot)+s("pass"," %s: ")+s(e.speed,"%dms");i.CR(),console.log(t,e.fullTitle(),e.duration)}),e.on("fail",function(e,t){i.CR(),console.log(s("fail"," %d) %s"),++o,e.fullTitle())}),e.on("end",t.epilogue.bind(t))}function u(){}var r=n("./base"),i=r.cursor,s=r.color;t=e.exports=o,u.prototype=r.prototype,o.prototype=new u,o.prototype.constructor=o}),e.register("reporters/markdown.js",function(e,t,n){function s(e){function u(e){return Array(s).join("#")+" "+e}function a(){return Array(s).join(" ")}function f(e,t){var n=t;return t=t[e.title]=t[e.title]||{suite:e},e.suites.forEach(function(e){f(e,t)}),n}function l(e,t){++t;var n="",r;for(var s in e){if("suite"==s)continue;s&&(r=" - ["+s+"](#"+i.slug(e[s].suite.fullTitle())+")\n"),s&&(n+=Array(t).join(" ")+r),n+=l(e[s],t)}return--t,n}function c(e){var t=f(e,{});return l(t,0)}r.call(this,e);var t=this,n=this.stats,s=0,o="";c(e.suite),e.on("suite",function(e){++s;var t=i.slug(e.fullTitle());o+=''+"\n",o+=u(e.title)+"\n"}),e.on("suite end",function(e){--s}),e.on("pass",function(e){var t=i.clean(e.fn.toString());o+=e.title+".\n",o+="\n```js\n",o+=t+"\n",o+="```\n\n"}),e.on("end",function(){process.stdout.write("# TOC\n"),process.stdout.write(c(e.suite)),process.stdout.write(o)})}var r=n("./base"),i=n("../utils");t=e.exports=s}),e.register("reporters/min.js",function(e,t,n){function i(e){r.call(this,e),e.on("start",function(){process.stdout.write(""),process.stdout.write("")}),e.on("end",this.epilogue.bind(this))}function s(){}var r=n("./base");t=e.exports=i,s.prototype=r.prototype,i.prototype=new s,i.prototype.constructor=i}),e.register("reporters/nyan.js",function(e,t,n){function s(e){r.call(this,e);var t=this,n=this.stats,i=r.window.width*.75|0,s=this.rainbowColors=t.generateColors(),u=this.colorIndex=0,a=this.numberOfLines=4,f=this.trajectories=[[],[],[],[]],l=this.nyanCatWidth=11,c=this.trajectoryWidthMax=i-l,h=this.scoreboardWidth=5,p=this.tick=0,d=0;e.on("start",function(){r.cursor.hide(),t.draw("start")}),e.on("pending",function(e){t.draw("pending")}),e.on("pass",function(e){t.draw("pass")}),e.on("fail",function(e,n){t.draw("fail")}),e.on("end",function(){r.cursor.show();for(var e=0;e=this.trajectoryWidthMax&&r.shift(),r.push(t)}},s.prototype.drawRainbow=function(){var e=this;this.trajectories.forEach(function(t,n){o("["+e.scoreboardWidth+"C"),o(t.join("")),o("\n")}),this.cursorUp(this.numberOfLines)},s.prototype.drawNyanCat=function(e){var t=this,n=this.scoreboardWidth+this.trajectories[0].length;[0,1,2,3].forEach(function(r){o("["+n+"C");switch(r){case 0:o("_,------,"),o("\n");break;case 1:var i=t.tick?" ":" ";o("_|"+i+"/\\_/\\ "),o("\n");break;case 2:var i=t.tick?"_":"__",s=t.tick?"~":"^",u;switch(e){case"pass":u="( ^ .^)";break;case"fail":u="( o .o)";break;default:u="( - .-)"}o(s+"|"+i+u+" "),o("\n");break;case 3:var i=t.tick?" ":" ";o(i+'"" "" '),o("\n")}}),this.cursorUp(this.numberOfLines)},s.prototype.cursorUp=function(e){o("["+e+"A")},s.prototype.cursorDown=function(e){o("["+e+"B")},s.prototype.generateColors=function(){var e=[];for(var t=0;t<42;t++){var n=Math.floor(Math.PI/3),r=t*(1/6),i=Math.floor(3*Math.sin(r)+3),s=Math.floor(3*Math.sin(r+2*n)+3),o=Math.floor(3*Math.sin(r+4*n)+3);e.push(36*i+6*s+o+16)}return e},s.prototype.rainbowify=function(e){var t=this.rainbowColors[this.colorIndex%this.rainbowColors.length];return this.colorIndex+=1,"[38;5;"+t+"m"+e+""},u.prototype=r.prototype,s.prototype=new u,s.prototype.constructor=s}),e.register("reporters/progress.js",function(e,t,n){function o(e,t){r.call(this,e);var n=this,t=t||{},o=this.stats,u=r.window.width*.5|0,a=e.total,f=0,l=Math.max;t.open=t.open||"[",t.complete=t.complete||"▬",t.incomplete=t.incomplete||r.symbols.dot,t.close=t.close||"]",t.verbose=!1,e.on("start",function(){console.log(),i.hide()}),e.on("test end",function(){f++;var e=a-f,n=f/a,r=u*n|0,o=u-r;i.CR(),process.stdout.write(""),process.stdout.write(s("progress"," "+t.open)),process.stdout.write(Array(r).join(t.complete)),process.stdout.write(Array(o).join(t.incomplete)),process.stdout.write(s("progress",t.close)),t.verbose&&process.stdout.write(s("progress"," "+f+" of "+a))}),e.on("end",function(){i.show(),console.log(),n.epilogue()})}function u(){}var r=n("./base"),i=r.cursor,s=r.color;t=e.exports=o,r.colors.progress=90,u.prototype=r.prototype,o.prototype=new u,o.prototype.constructor=o}),e.register("reporters/spec.js",function(e,t,n){function o(e){function a(){return Array(o).join(" ")}r.call(this,e);var t=this,n=this.stats,o=0,u=0;e.on("start",function(){console.log()}),e.on("suite",function(e){++o,console.log(s("suite","%s%s"),a(),e.title)}),e.on("suite end",function(e){--o,1==o&&console.log()}),e.on("test",function(e){process.stdout.write(a()+s("pass"," ◦ "+e.title+": "))}),e.on("pending",function(e){var t=a()+s("pending"," - %s");console.log(t,e.title)}),e.on("pass",function(e){if("fast"==e.speed){var t=a()+s("checkmark"," "+r.symbols.ok)+s("pass"," %s ");i.CR(),console.log(t,e.title)}else{var t=a()+s("checkmark"," "+r.symbols.ok)+s("pass"," %s ")+s(e.speed,"(%dms)");i.CR(),console.log(t,e.title,e.duration)}}),e.on("fail",function(e,t){i.CR(),console.log(a()+s("fail"," %d) %s"),++u,e.title)}),e.on("end",t.epilogue.bind(t))}function u(){}var r=n("./base"),i=r.cursor,s=r.color;t=e.exports=o,u.prototype=r.prototype,o.prototype=new u,o.prototype.constructor=o}),e.register("reporters/tap.js",function(e,t,n){function o(e){r.call(this,e);var t=this,n=this.stats,i=1,s=0,o=0;e.on("start",function(){var t=e.grepTotal(e.suite);console.log("%d..%d",1,t)}),e.on("test end",function(){++i}),e.on("pending",function( e){console.log("ok %d %s # SKIP -",i,u(e))}),e.on("pass",function(e){s++,console.log("ok %d %s",i,u(e))}),e.on("fail",function(e,t){o++,console.log("not ok %d %s",i,u(e)),t.stack&&console.log(t.stack.replace(/^/gm," "))}),e.on("end",function(){console.log("# tests "+(s+o)),console.log("# pass "+s),console.log("# fail "+o)})}function u(e){return e.fullTitle().replace(/#/g,"")}var r=n("./base"),i=r.cursor,s=r.color;t=e.exports=o}),e.register("reporters/teamcity.js",function(e,t,n){function i(e){r.call(this,e);var t=this.stats;e.on("start",function(){console.log("##teamcity[testSuiteStarted name='mocha.suite']")}),e.on("test",function(e){console.log("##teamcity[testStarted name='"+s(e.fullTitle())+"']")}),e.on("fail",function(e,t){console.log("##teamcity[testFailed name='"+s(e.fullTitle())+"' message='"+s(t.message)+"']")}),e.on("pending",function(e){console.log("##teamcity[testIgnored name='"+s(e.fullTitle())+"' message='pending']")}),e.on("test end",function(e){console.log("##teamcity[testFinished name='"+s(e.fullTitle())+"' duration='"+e.duration+"']")}),e.on("end",function(){console.log("##teamcity[testSuiteFinished name='mocha.suite' duration='"+t.duration+"']")})}function s(e){return e.replace(/\|/g,"||").replace(/\n/g,"|n").replace(/\r/g,"|r").replace(/\[/g,"|[").replace(/\]/g,"|]").replace(/\u0085/g,"|x").replace(/\u2028/g,"|l").replace(/\u2029/g,"|p").replace(/'/g,"|'")}var r=n("./base");t=e.exports=i}),e.register("reporters/xunit.js",function(e,t,n){function c(e){r.call(this,e);var t=this.stats,n=[],i=this;e.on("pass",function(e){n.push(e)}),e.on("fail",function(e){n.push(e)}),e.on("end",function(){console.log(d("testsuite",{name:"Mocha Tests",tests:t.tests,failures:t.failures,errors:t.failures,skip:t.tests-t.failures-t.passes,timestamp:(new o).toUTCString(),time:t.duration/1e3},!1)),n.forEach(p),console.log("")})}function h(){}function p(e){var t={classname:e.parent.fullTitle(),name:e.title,time:e.duration/1e3};if("failed"==e.state){var n=e.err;t.message=s(n.message),console.log(d("testcase",t,!1,d("failure",t,!1,v(n.stack))))}else e.pending?console.log(d("testcase",t,!1,d("skipped",{},!0))):console.log(d("testcase",t,!0))}function d(e,t,n,r){var i=n?"/>":">",o=[],u;for(var a in t)o.push(a+'="'+s(t[a])+'"');return u="<"+e+(o.length?" "+o.join(" "):"")+i,r&&(u+=r+""}var r=n("./base"),i=n("../utils"),s=i.escape,o=global.Date,u=global.setTimeout,a=global.setInterval,f=global.clearTimeout,l=global.clearInterval;t=e.exports=c,h.prototype=r.prototype,c.prototype=new h,c.prototype.constructor=c}),e.register("runnable.js",function(e,t,n){function h(e,t){this.title=e,this.fn=t,this.async=t&&t.length,this.sync=!this.async,this._timeout=2e3,this._slow=75,this.timedOut=!1}function p(){}var r=n("browser/events").EventEmitter,i=n("browser/debug")("mocha:runnable"),s=n("./ms"),o=global.Date,u=global.setTimeout,a=global.setInterval,f=global.clearTimeout,l=global.clearInterval,c=Object.prototype.toString;e.exports=h,p.prototype=r.prototype,h.prototype=new p,h.prototype.constructor=h,h.prototype.timeout=function(e){return 0==arguments.length?this._timeout:("string"==typeof e&&(e=s(e)),i("timeout %d",e),this._timeout=e,this.timer&&this.resetTimeout(),this)},h.prototype.slow=function(e){return 0===arguments.length?this._slow:("string"==typeof e&&(e=s(e)),i("timeout %d",e),this._slow=e,this)},h.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},h.prototype.clearTimeout=function(){f(this.timer)},h.prototype.inspect=function(){return JSON.stringify(this,function(e,t){if("_"==e[0])return;return"parent"==e?"#":"ctx"==e?"#":t},2)},h.prototype.resetTimeout=function(){var e=this,t=this.timeout();this.clearTimeout(),t&&(this.timer=u(function(){e.callback(new Error("timeout of "+t+"ms exceeded")),e.timedOut=!0},t))},h.prototype.run=function(e){function f(e){if(a)return;a=!0,t.emit("error",e||new Error("done() called multiple times"))}function l(n){if(t.timedOut)return;if(s)return f(n);t.clearTimeout(),t.duration=new o-r,s=!0,e(n)}var t=this,n=this.timeout(),r=new o,i=this.ctx,s,a;i&&i.runnable(this),this.async&&n&&(this.timer=u(function(){l(new Error("timeout of "+n+"ms exceeded")),t.timedOut=!0},n)),this.callback=l;if(this.async){try{this.fn.call(i,function(e){if(e instanceof Error||c.call(e)==="[object Error]")return l(e);if(null!=e)return l(new Error("done() invoked with non-Error: "+e));l()})}catch(h){l(h)}return}if(this.asyncOnly)return l(new Error("--async-only option in use without declaring `done()`"));try{this.pending||this.fn.call(i),this.duration=new o-r,e()}catch(h){e(h)}}}),e.register("runner.js",function(e,t,n){function c(e){var t=this;this._globals=[],this.suite=e,this.total=e.total(),this.failures=0,this.on("test end",function(e){t.checkGlobals(e)}),this.on("hook end",function(e){t.checkGlobals(e)}),this.grep(/.*/),this.globals(this.globalProps().concat(["errno"]))}function h(){}function p(e,t){return u(t,function(t){var n=u(e,function(e){return~e.indexOf("*")?0==t.indexOf(e.split("*")[0]):/^mocha-/.test(t)?!0:t==e});return n.length==0&&(!global.navigator||"onerror"!==t)})}var r=n("browser/events").EventEmitter,i=n("browser/debug")("mocha:runner"),s=n("./test"),o=n("./utils"),u=o.filter,a=o.keys,f=function(){},l=["setTimeout","clearTimeout","setInterval","clearInterval","XMLHttpRequest","Date"];e.exports=c,h.prototype=r.prototype,c.prototype=new h,c.prototype.constructor=c,c.prototype.grep=function(e,t){return i("grep %s",e),this._grep=e,this._invert=t,this.total=this.grepTotal(this.suite),this},c.prototype.grepTotal=function(e){var t=this,n=0;return e.eachTest(function(e){var r=t._grep.test(e.fullTitle());t._invert&&(r=!r),r&&n++}),n},c.prototype.globalProps=function(){var e=o.keys(global);for(var t=0;t1?this.fail(e,new Error("global leaks detected: "+i.join(", ")+"")):i.length&&this.fail(e,new Error("global leak detected: "+i[0]))},c.prototype.fail=function(e,t){++this.failures,e.state="failed","string"==typeof t&&(t=new Error('the string "'+t+'" was thrown, throw an Error :)')),this.emit("fail",e,t)},c.prototype.failHook=function(e,t){this.fail(e,t),this.emit("end")},c.prototype.hook=function(e,t){function o(e){var n=r[e];if(!n)return t();i.currentRunnable=n,i.emit("hook",n),n.on("error",function(e){i.failHook(n,e)}),n.run(function(t){n.removeAllListeners("error");var r=n.error();r&&i.fail(i.test,r);if(t)return i.failHook(n,t);i.emit("hook end",n),o(++e)})}var n=this.suite,r=n["_"+e],i=this,s;process.nextTick(function(){o(0)})},c.prototype.hooks=function(e,t,n){function s(o){r.suite=o;if(!o)return r.suite=i,n();r.hook(e,function(e){if(e)return r.suite=i,n(e);s(t.pop())})}var r=this,i=this.suite;s(t.pop())},c.prototype.hookUp=function(e,t){var n=[this.suite].concat(this.parents()).reverse();this.hooks(e,n,t)},c.prototype.hookDown=function(e,t){var n=[this.suite].concat(this.parents());this.hooks(e,n,t)},c.prototype.parents=function(){var e=this.suite,t=[];while(e=e.parent)t.push(e);return t},c.prototype.runTest=function(e){var t=this.test,n=this;this.asyncOnly&&(t.asyncOnly=!0);try{t.on("error",function(e){n.fail(t,e)}),t.run(e)}catch(r){e(r)}},c.prototype.runTests=function(e,t){function s(o){if(n.failures&&e._bail)return t();i=r.shift();if(!i)return t();var u=n._grep.test(i.fullTitle());n._invert&&(u=!u);if(!u)return s();if(i.pending)return n.emit("pending",i),n.emit("test end",i),s();n.emit("test",n.test=i),n.hookDown("beforeEach",function(){n.currentRunnable=n.test,n.runTest(function(e){i=n.test;if(e)return n.fail(i,e),n.emit("test end",i),n.hookUp("afterEach",s);i.state="passed",n.emit("pass",i),n.emit("test end",i),n.hookUp("afterEach",s)})})}var n=this,r=e.tests.slice(),i;this.next=s,s()},c.prototype.runSuite=function(e,t){function o(){var t=e.suites[s++];if(!t)return u();r.runSuite(t,o)}function u(){r.suite=e,r.hook("afterAll",function(){r.emit("suite end",e),t()})}var n=this.grepTotal(e),r=this,s=0;i("run suite %s",e.fullTitle());if(!n)return t();this.emit("suite",this.suite=e),this.hook("beforeAll",function(){r.runTests(e,o)})},c.prototype.uncaught=function(e){i("uncaught exception %s",e.message);var t=this.currentRunnable;if(!t||"failed"==t.state)return;t.clearTimeout(),e.uncaught=!0,this.fail(t,e);if("test"==t.type){this.emit("test end",t),this.hookUp("afterEach",this.next);return}this.emit("end")},c.prototype.run=function(e){var t=this,e=e||function(){};return i("start"),this.on("end",function(){i("end"),process.removeListener("uncaughtException",function(e){t.uncaught(e)}),e(t.failures)}),this.emit("start"),this.runSuite(this.suite,function(){i("finished running"),t.emit("end")}),process.on("uncaughtException",function(e){t.uncaught(e)}),this}}),e.register("suite.js",function(e,t,n){function a(e,t){this.title=e,this.ctx=t,this.suites=[],this.tests=[],this.pending=!1,this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!e,this._timeout=2e3,this._slow=75,this._bail=!1}function f(){}var r=n("browser/events").EventEmitter,i=n("browser/debug")("mocha:suite"),s=n("./ms"),o=n("./utils"),u=n("./hook");t=e.exports=a,t.create=function(e,t){var n=new a(t,e.ctx);return n.parent=e,e.pending&&(n.pending=!0),t=n.fullTitle(),e.addSuite(n),n},f.prototype=r.prototype,a.prototype=new f,a.prototype.constructor=a,a.prototype.clone=function(){var e=new a(this.title);return i("clone"),e.ctx=this.ctx,e.timeout(this.timeout()),e.slow(this.slow()),e.bail(this.bail()),e},a.prototype.timeout=function(e){return 0==arguments.length?this._timeout:("string"==typeof e&&(e=s(e)),i("timeout %d",e),this._timeout=parseInt(e,10),this)},a.prototype.slow=function(e){return 0===arguments.length?this._slow:("string"==typeof e&&(e=s(e)),i("slow %d",e),this._slow=e,this)},a.prototype.bail=function(e){return 0==arguments.length?this._bail:(i("bail %s",e),this._bail=e,this)},a.prototype.beforeAll=function(e){if(this.pending)return this;var t=new u('"before all" hook',e);return t.parent=this,t.timeout(this.timeout()),t.slow(this.slow()),t.ctx=this.ctx,this._beforeAll.push(t),this.emit("beforeAll",t),this},a.prototype.afterAll=function(e){if(this.pending)return this;var t=new u('"after all" hook',e);return t.parent=this,t.timeout(this.timeout()),t.slow(this.slow()),t.ctx=this.ctx,this._afterAll.push(t),this.emit("afterAll",t),this},a.prototype.beforeEach=function(e){if(this.pending)return this;var t=new u('"before each" hook',e);return t.parent=this,t.timeout(this.timeout()),t.slow(this.slow()),t.ctx=this.ctx,this._beforeEach.push(t),this.emit("beforeEach",t),this},a.prototype.afterEach=function(e){if(this.pending)return this;var t=new u('"after each" hook',e);return t.parent=this,t.timeout(this.timeout()),t.slow(this.slow()),t.ctx=this.ctx,this._afterEach.push(t),this.emit("afterEach",t),this},a.prototype.addSuite=function(e){return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.bail(this.bail()),this.suites.push(e),this.emit("suite",e),this},a.prototype.addTest=function(e){return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this.tests.push(e),this.emit("test",e),this},a.prototype.fullTitle=function(){if(this.parent){var e=this.parent.fullTitle();if(e)return e+" "+this.title}return this.title},a.prototype.total=function(){return o.reduce(this.suites,function(e,t){return e+t.total()},0)+this.tests.length},a.prototype.eachTest=function(e){return o.forEach(this.tests,e),o.forEach(this.suites,function(t){t.eachTest(e)}),this}}),e.register("test.js",function(e,t,n){function i(e,t){r.call(this,e,t),this.pending=!t,this.type="test"}function s(){}var r=n("./runnable");e.exports=i,s.prototype=r.prototype,i.prototype=new s,i.prototype.constructor=i}),e.register("utils.js",function(e,t,n){function a(e){return!~u.indexOf(e)}function f(e){return e.replace(//g,">").replace(/\/\/(.*)/gm,'//$1').replace(/('.*?')/gm,'$1').replace(/(\d+\.\d+)/gm,'$1').replace(/(\d+)/gm,'$1').replace(/\bnew *(\w+)/gm,'new $1').replace(/\b(function|new|throw|return|var|if|else)\b/gm,'$1')}var r=n("browser/fs"),i=n("browser/path"),s=i.join,o=n("browser/debug")("mocha:watch"),u=["node_modules",".git"];t.escape=function(e){return String(e).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")},t.forEach=function(e,t,n){for(var r=0,i=e.length;r