dwf: merging in Xian's multi-reporter updates
This commit is contained in:
parent
f451e633cb
commit
708d148d31
156
doc/files.html
156
doc/files.html
|
@ -190,12 +190,20 @@ ul.inheritsList
|
|||
|
||||
<li><a href="symbols/jasmine.ActionCollection.html">jasmine.ActionCollection</a></li>
|
||||
|
||||
<li><a href="symbols/jasmine.Env.html">jasmine.Env</a></li>
|
||||
|
||||
<li><a href="symbols/jasmine.MultiReporter.html">jasmine.MultiReporter</a></li>
|
||||
|
||||
<li><a href="symbols/jasmine.NestedResults.html">jasmine.NestedResults</a></li>
|
||||
|
||||
<li><a href="symbols/jasmine.QueuedFunction.html">jasmine.QueuedFunction</a></li>
|
||||
|
||||
<li><a href="symbols/jasmine.Reporter.html">jasmine.Reporter</a></li>
|
||||
|
||||
<li><a href="symbols/jasmine.Runner.html">jasmine.Runner</a></li>
|
||||
|
||||
<li><a href="symbols/jasmine.Spec.html">jasmine.Spec</a></li>
|
||||
|
||||
<li><a href="symbols/jasmine.Spy.html">jasmine.Spy</a></li>
|
||||
|
||||
<li><a href="symbols/jasmine.Suite.html">jasmine.Suite</a></li>
|
||||
|
@ -211,151 +219,7 @@ ul.inheritsList
|
|||
|
||||
|
||||
<div>
|
||||
<h2><a href="symbols/src/src_ActionCollection.js.html">src/ActionCollection.js</a></h2>
|
||||
|
||||
<dl>
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
</div>
|
||||
<hr />
|
||||
|
||||
<div>
|
||||
<h2><a href="symbols/src/src_base.js.html">src/base.js</a></h2>
|
||||
|
||||
<dl>
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
</div>
|
||||
<hr />
|
||||
|
||||
<div>
|
||||
<h2><a href="symbols/src/src_Env.js.html">src/Env.js</a></h2>
|
||||
|
||||
<dl>
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
</div>
|
||||
<hr />
|
||||
|
||||
<div>
|
||||
<h2><a href="symbols/src/src_Matchers.js.html">src/Matchers.js</a></h2>
|
||||
|
||||
<dl>
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
</div>
|
||||
<hr />
|
||||
|
||||
<div>
|
||||
<h2><a href="symbols/src/src_mock-timeout.js.html">src/mock-timeout.js</a></h2>
|
||||
|
||||
<dl>
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
</div>
|
||||
<hr />
|
||||
|
||||
<div>
|
||||
<h2><a href="symbols/src/src_NestedResults.js.html">src/NestedResults.js</a></h2>
|
||||
|
||||
<dl>
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
</div>
|
||||
<hr />
|
||||
|
||||
<div>
|
||||
<h2><a href="symbols/src/src_PrettyPrinter.js.html">src/PrettyPrinter.js</a></h2>
|
||||
|
||||
<dl>
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
</div>
|
||||
<hr />
|
||||
|
||||
<div>
|
||||
<h2><a href="symbols/src/src_QueuedFunction.js.html">src/QueuedFunction.js</a></h2>
|
||||
|
||||
<dl>
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
</div>
|
||||
<hr />
|
||||
|
||||
<div>
|
||||
<h2><a href="symbols/src/src_Reporters.js.html">src/Reporters.js</a></h2>
|
||||
|
||||
<dl>
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
</div>
|
||||
<hr />
|
||||
|
||||
<div>
|
||||
<h2><a href="symbols/src/src_Runner.js.html">src/Runner.js</a></h2>
|
||||
|
||||
<dl>
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
</div>
|
||||
<hr />
|
||||
|
||||
<div>
|
||||
<h2><a href="symbols/src/src_Spec.js.html">src/Spec.js</a></h2>
|
||||
|
||||
<dl>
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
</div>
|
||||
<hr />
|
||||
|
||||
<div>
|
||||
<h2><a href="symbols/src/src_Suite.js.html">src/Suite.js</a></h2>
|
||||
|
||||
<dl>
|
||||
|
||||
|
||||
|
||||
|
||||
</dl>
|
||||
</div>
|
||||
<hr />
|
||||
|
||||
<div>
|
||||
<h2><a href="symbols/src/src_util.js.html">src/util.js</a></h2>
|
||||
<h2><a href="symbols/src/lib_jasmine.js.html">lib/jasmine.js</a></h2>
|
||||
|
||||
<dl>
|
||||
|
||||
|
@ -370,7 +234,7 @@ ul.inheritsList
|
|||
</div>
|
||||
<div class="fineprint" style="clear:both">
|
||||
|
||||
Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blankt">JsDoc Toolkit</a> 2.3.0 on Sun Jun 28 2009 13:34:06 GMT-0700 (PDT)
|
||||
Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blankt">JsDoc Toolkit</a> 2.3.0 on Thu Jul 09 2009 21:42:19 GMT-0700 (PDT)
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -190,12 +190,20 @@ ul.inheritsList
|
|||
|
||||
<li><a href="symbols/jasmine.ActionCollection.html">jasmine.ActionCollection</a></li>
|
||||
|
||||
<li><a href="symbols/jasmine.Env.html">jasmine.Env</a></li>
|
||||
|
||||
<li><a href="symbols/jasmine.MultiReporter.html">jasmine.MultiReporter</a></li>
|
||||
|
||||
<li><a href="symbols/jasmine.NestedResults.html">jasmine.NestedResults</a></li>
|
||||
|
||||
<li><a href="symbols/jasmine.QueuedFunction.html">jasmine.QueuedFunction</a></li>
|
||||
|
||||
<li><a href="symbols/jasmine.Reporter.html">jasmine.Reporter</a></li>
|
||||
|
||||
<li><a href="symbols/jasmine.Runner.html">jasmine.Runner</a></li>
|
||||
|
||||
<li><a href="symbols/jasmine.Spec.html">jasmine.Spec</a></li>
|
||||
|
||||
<li><a href="symbols/jasmine.Spy.html">jasmine.Spy</a></li>
|
||||
|
||||
<li><a href="symbols/jasmine.Suite.html">jasmine.Suite</a></li>
|
||||
|
@ -228,6 +236,18 @@ ul.inheritsList
|
|||
</div>
|
||||
<hr />
|
||||
|
||||
<div>
|
||||
<h2><a href="symbols/jasmine.Env.html">jasmine.Env</a></h2>
|
||||
|
||||
</div>
|
||||
<hr />
|
||||
|
||||
<div>
|
||||
<h2><a href="symbols/jasmine.MultiReporter.html">jasmine.MultiReporter</a></h2>
|
||||
|
||||
</div>
|
||||
<hr />
|
||||
|
||||
<div>
|
||||
<h2><a href="symbols/jasmine.NestedResults.html">jasmine.NestedResults</a></h2>
|
||||
|
||||
|
@ -240,12 +260,24 @@ ul.inheritsList
|
|||
</div>
|
||||
<hr />
|
||||
|
||||
<div>
|
||||
<h2><a href="symbols/jasmine.Reporter.html">jasmine.Reporter</a></h2>
|
||||
|
||||
</div>
|
||||
<hr />
|
||||
|
||||
<div>
|
||||
<h2><a href="symbols/jasmine.Runner.html">jasmine.Runner</a></h2>
|
||||
|
||||
</div>
|
||||
<hr />
|
||||
|
||||
<div>
|
||||
<h2><a href="symbols/jasmine.Spec.html">jasmine.Spec</a></h2>
|
||||
|
||||
</div>
|
||||
<hr />
|
||||
|
||||
<div>
|
||||
<h2><a href="symbols/jasmine.Spy.html">jasmine.Spy</a></h2>
|
||||
|
||||
|
@ -268,7 +300,7 @@ ul.inheritsList
|
|||
</div>
|
||||
<div class="fineprint" style="clear:both">
|
||||
|
||||
Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blankt">JsDoc Toolkit</a> 2.3.0 on Sun Jun 28 2009 13:34:06 GMT-0700 (PDT)
|
||||
Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blankt">JsDoc Toolkit</a> 2.3.0 on Thu Jul 09 2009 21:42:19 GMT-0700 (PDT)
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -195,12 +195,20 @@ ul.inheritsList
|
|||
|
||||
<li><a href="../symbols/jasmine.ActionCollection.html">jasmine.ActionCollection</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Env.html">jasmine.Env</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.MultiReporter.html">jasmine.MultiReporter</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.NestedResults.html">jasmine.NestedResults</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.QueuedFunction.html">jasmine.QueuedFunction</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Reporter.html">jasmine.Reporter</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Runner.html">jasmine.Runner</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Spec.html">jasmine.Spec</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Spy.html">jasmine.Spy</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Suite.html">jasmine.Suite</a></li>
|
||||
|
@ -381,7 +389,7 @@ ul.inheritsList
|
|||
Used for restoring any state that is hijacked during spec execution.
|
||||
|
||||
<br />
|
||||
<i>Defined in: </i> <a href="../symbols/src/src_base.js.html">base.js</a>.
|
||||
<i>Defined in: </i> <a href="../symbols/src/lib_jasmine.js.html">jasmine.js</a>.
|
||||
|
||||
|
||||
</div>
|
||||
|
@ -422,7 +430,7 @@ Used for restoring any state that is hijacked during spec execution.
|
|||
Used for spec setup, including validating assumptions.
|
||||
|
||||
<br />
|
||||
<i>Defined in: </i> <a href="../symbols/src/src_base.js.html">base.js</a>.
|
||||
<i>Defined in: </i> <a href="../symbols/src/lib_jasmine.js.html">jasmine.js</a>.
|
||||
|
||||
|
||||
</div>
|
||||
|
@ -465,7 +473,7 @@ are accessible by calls to beforeEach, it, and afterEach. Describe blocks can be
|
|||
of setup in some tests.
|
||||
|
||||
<br />
|
||||
<i>Defined in: </i> <a href="../symbols/src/src_base.js.html">base.js</a>.
|
||||
<i>Defined in: </i> <a href="../symbols/src/lib_jasmine.js.html">jasmine.js</a>.
|
||||
|
||||
|
||||
</div>
|
||||
|
@ -519,7 +527,7 @@ It is passed an Object that is the actual value and should chain to one of the m
|
|||
jasmine.Matchers functions.
|
||||
|
||||
<br />
|
||||
<i>Defined in: </i> <a href="../symbols/src/src_base.js.html">base.js</a>.
|
||||
<i>Defined in: </i> <a href="../symbols/src/lib_jasmine.js.html">jasmine.js</a>.
|
||||
|
||||
|
||||
</div>
|
||||
|
@ -560,7 +568,7 @@ jasmine.Matchers functions.
|
|||
// TODO: pending tests
|
||||
|
||||
<br />
|
||||
<i>Defined in: </i> <a href="../symbols/src/src_base.js.html">base.js</a>.
|
||||
<i>Defined in: </i> <a href="../symbols/src/lib_jasmine.js.html">jasmine.js</a>.
|
||||
|
||||
|
||||
</div>
|
||||
|
@ -611,7 +619,7 @@ jasmine.Matchers functions.
|
|||
Defines part of a jasmine spec. Used in cominbination with waits or waitsFor in asynchrnous specs.
|
||||
|
||||
<br />
|
||||
<i>Defined in: </i> <a href="../symbols/src/src_base.js.html">base.js</a>.
|
||||
<i>Defined in: </i> <a href="../symbols/src/lib_jasmine.js.html">jasmine.js</a>.
|
||||
|
||||
|
||||
</div>
|
||||
|
@ -650,7 +658,7 @@ jasmine.Matchers functions.
|
|||
Function that installs a spy on an existing object's method name. Used within a Spec to create a spy.
|
||||
|
||||
<br />
|
||||
<i>Defined in: </i> <a href="../symbols/src/src_base.js.html">base.js</a>.
|
||||
<i>Defined in: </i> <a href="../symbols/src/lib_jasmine.js.html">jasmine.js</a>.
|
||||
|
||||
|
||||
</div>
|
||||
|
@ -699,7 +707,7 @@ spyOn(foo, 'not'); // actual foo.not will not be called, execution stops</pre>
|
|||
<dl class="detailList">
|
||||
<dt class="heading">See:</dt>
|
||||
|
||||
<dd><a href="../symbols/jasmine.html#.createSpy">jasmine.createSpy</a></dd>
|
||||
<dd>jasmine.createSpy</dd>
|
||||
|
||||
</dl>
|
||||
|
||||
|
@ -717,7 +725,7 @@ spyOn(foo, 'not'); // actual foo.not will not be called, execution stops</pre>
|
|||
Waits for a timeout before moving to the next runs()-defined block.
|
||||
|
||||
<br />
|
||||
<i>Defined in: </i> <a href="../symbols/src/src_base.js.html">base.js</a>.
|
||||
<i>Defined in: </i> <a href="../symbols/src/lib_jasmine.js.html">jasmine.js</a>.
|
||||
|
||||
|
||||
</div>
|
||||
|
@ -756,7 +764,7 @@ spyOn(foo, 'not'); // actual foo.not will not be called, execution stops</pre>
|
|||
Waits for the latchFunction to return true before proceeding to the next runs()-defined block.
|
||||
|
||||
<br />
|
||||
<i>Defined in: </i> <a href="../symbols/src/src_base.js.html">base.js</a>.
|
||||
<i>Defined in: </i> <a href="../symbols/src/lib_jasmine.js.html">jasmine.js</a>.
|
||||
|
||||
|
||||
</div>
|
||||
|
@ -807,7 +815,7 @@ spyOn(foo, 'not'); // actual foo.not will not be called, execution stops</pre>
|
|||
Disables a suite of specifications. Used to disable some suites in a file, or files, temporarily during development.
|
||||
|
||||
<br />
|
||||
<i>Defined in: </i> <a href="../symbols/src/src_base.js.html">base.js</a>.
|
||||
<i>Defined in: </i> <a href="../symbols/src/lib_jasmine.js.html">jasmine.js</a>.
|
||||
|
||||
|
||||
</div>
|
||||
|
@ -854,7 +862,7 @@ spyOn(foo, 'not'); // actual foo.not will not be called, execution stops</pre>
|
|||
A convenience method that allows existing specs to be disabled temporarily during development.
|
||||
|
||||
<br />
|
||||
<i>Defined in: </i> <a href="../symbols/src/src_base.js.html">base.js</a>.
|
||||
<i>Defined in: </i> <a href="../symbols/src/lib_jasmine.js.html">jasmine.js</a>.
|
||||
|
||||
|
||||
</div>
|
||||
|
@ -900,7 +908,7 @@ A convenience method that allows existing specs to be disabled temporarily durin
|
|||
<!-- ============================== footer ================================= -->
|
||||
<div class="fineprint" style="clear:both">
|
||||
|
||||
Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.3.0 on Sun Jun 28 2009 13:34:05 GMT-0700 (PDT)
|
||||
Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.3.0 on Thu Jul 09 2009 21:42:18 GMT-0700 (PDT)
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -195,12 +195,20 @@ ul.inheritsList
|
|||
|
||||
<li><a href="../symbols/jasmine.ActionCollection.html">jasmine.ActionCollection</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Env.html">jasmine.Env</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.MultiReporter.html">jasmine.MultiReporter</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.NestedResults.html">jasmine.NestedResults</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.QueuedFunction.html">jasmine.QueuedFunction</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Reporter.html">jasmine.Reporter</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Runner.html">jasmine.Runner</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Spec.html">jasmine.Spec</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Spy.html">jasmine.Spy</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Suite.html">jasmine.Suite</a></li>
|
||||
|
@ -226,7 +234,7 @@ ul.inheritsList
|
|||
|
||||
|
||||
|
||||
<br /><i>Defined in: </i> <a href="../symbols/src/src_ActionCollection.js.html">ActionCollection.js</a>.
|
||||
<br /><i>Defined in: </i> <a href="../symbols/src/lib_jasmine.js.html">jasmine.js</a>.
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -309,15 +317,6 @@ ul.inheritsList
|
|||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="attributes"> </td>
|
||||
<td class="nameDescription">
|
||||
<div class="fixedFont"><b><a href="../symbols/jasmine.ActionCollection.html#waitForDone">waitForDone</a></b>(action)
|
||||
</div>
|
||||
<div class="description"></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
@ -353,7 +352,7 @@ ul.inheritsList
|
|||
<dt class="heading">Parameters:</dt>
|
||||
|
||||
<dt>
|
||||
<span class="light fixedFont">{<a href="../symbols/jasmine.html#.Env">jasmine.Env</a>}</span> <b>env</b>
|
||||
<span class="light fixedFont">{<a href="../symbols/jasmine.Env.html">jasmine.Env</a>}</span> <b>env</b>
|
||||
|
||||
</dt>
|
||||
<dd></dd>
|
||||
|
@ -477,42 +476,6 @@ ul.inheritsList
|
|||
|
||||
|
||||
|
||||
<hr />
|
||||
|
||||
<a name="waitForDone"> </a>
|
||||
<div class="fixedFont">
|
||||
|
||||
|
||||
<b>waitForDone</b>(action)
|
||||
|
||||
</div>
|
||||
<div class="description">
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="detailList">
|
||||
<dt class="heading">Parameters:</dt>
|
||||
|
||||
<dt>
|
||||
<b>action</b>
|
||||
|
||||
</dt>
|
||||
<dd></dd>
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -527,7 +490,7 @@ ul.inheritsList
|
|||
<!-- ============================== footer ================================= -->
|
||||
<div class="fineprint" style="clear:both">
|
||||
|
||||
Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.3.0 on Sun Jun 28 2009 13:34:05 GMT-0700 (PDT)
|
||||
Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.3.0 on Thu Jul 09 2009 21:42:18 GMT-0700 (PDT)
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -197,12 +197,18 @@ ul.inheritsList
|
|||
|
||||
<li><a href="../symbols/jasmine.Env.html">jasmine.Env</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.MultiReporter.html">jasmine.MultiReporter</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.NestedResults.html">jasmine.NestedResults</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.QueuedFunction.html">jasmine.QueuedFunction</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Reporter.html">jasmine.Reporter</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Runner.html">jasmine.Runner</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Spec.html">jasmine.Spec</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Spy.html">jasmine.Spy</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Suite.html">jasmine.Suite</a></li>
|
||||
|
@ -228,7 +234,7 @@ ul.inheritsList
|
|||
|
||||
|
||||
|
||||
<br /><i>Defined in: </i> <a href="../symbols/src/src_Env.js.html">Env.js</a>.
|
||||
<br /><i>Defined in: </i> <a href="../symbols/src/lib_jasmine.js.html">jasmine.js</a>.
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -249,7 +255,7 @@ ul.inheritsList
|
|||
<div class="fixedFont">
|
||||
<b><a href="../symbols/jasmine.Env.html#constructor">jasmine.Env</a></b>()
|
||||
</div>
|
||||
<div class="description">Env</div>
|
||||
<div class="description">Environment for Jasmine</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -276,108 +282,9 @@ ul.inheritsList
|
|||
<tr>
|
||||
<td class="attributes"> </td>
|
||||
<td class="nameDescription">
|
||||
<div class="fixedFont"><b><a href="../symbols/jasmine.Env.html#addEqualityTester">addEqualityTester</a></b>(equalityTester)
|
||||
<div class="fixedFont"><b><a href="../symbols/jasmine.Env.html#addReporter">addReporter</a></b>(reporter)
|
||||
</div>
|
||||
<div class="description"></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="attributes"> </td>
|
||||
<td class="nameDescription">
|
||||
<div class="fixedFont"><b><a href="../symbols/jasmine.Env.html#afterEach">afterEach</a></b>(afterEachFunction)
|
||||
</div>
|
||||
<div class="description"></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="attributes"> </td>
|
||||
<td class="nameDescription">
|
||||
<div class="fixedFont"><b><a href="../symbols/jasmine.Env.html#beforeEach">beforeEach</a></b>(beforeEachFunction)
|
||||
</div>
|
||||
<div class="description"></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="attributes"> </td>
|
||||
<td class="nameDescription">
|
||||
<div class="fixedFont"><b><a href="../symbols/jasmine.Env.html#compareObjects_">compareObjects_</a></b>(a, b, mismatchKeys, mismatchValues)
|
||||
</div>
|
||||
<div class="description"></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="attributes"> </td>
|
||||
<td class="nameDescription">
|
||||
<div class="fixedFont"><b><a href="../symbols/jasmine.Env.html#contains_">contains_</a></b>(haystack, needle)
|
||||
</div>
|
||||
<div class="description"></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="attributes"> </td>
|
||||
<td class="nameDescription">
|
||||
<div class="fixedFont"><b><a href="../symbols/jasmine.Env.html#describe">describe</a></b>(description, specDefinitions)
|
||||
</div>
|
||||
<div class="description"></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="attributes"> </td>
|
||||
<td class="nameDescription">
|
||||
<div class="fixedFont"><b><a href="../symbols/jasmine.Env.html#equals_">equals_</a></b>(a, b, mismatchKeys, mismatchValues)
|
||||
</div>
|
||||
<div class="description"></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="attributes"> </td>
|
||||
<td class="nameDescription">
|
||||
<div class="fixedFont"><b><a href="../symbols/jasmine.Env.html#execute">execute</a></b>()
|
||||
</div>
|
||||
<div class="description"></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="attributes"> </td>
|
||||
<td class="nameDescription">
|
||||
<div class="fixedFont"><b><a href="../symbols/jasmine.Env.html#it">it</a></b>(description, func)
|
||||
</div>
|
||||
<div class="description"></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="attributes"> </td>
|
||||
<td class="nameDescription">
|
||||
<div class="fixedFont"><b><a href="../symbols/jasmine.Env.html#specFilter">specFilter</a></b>()
|
||||
</div>
|
||||
<div class="description"></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="attributes"> </td>
|
||||
<td class="nameDescription">
|
||||
<div class="fixedFont"><b><a href="../symbols/jasmine.Env.html#xdescribe">xdescribe</a></b>(desc, specDefinitions)
|
||||
</div>
|
||||
<div class="description"></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="attributes"> </td>
|
||||
<td class="nameDescription">
|
||||
<div class="fixedFont"><b><a href="../symbols/jasmine.Env.html#xit">xit</a></b>(desc, func)
|
||||
</div>
|
||||
<div class="description"></div>
|
||||
<div class="description">Register a reporter to receive status updates from Jasmine.</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
@ -402,7 +309,7 @@ ul.inheritsList
|
|||
</div>
|
||||
|
||||
<div class="description">
|
||||
Env
|
||||
Environment for Jasmine
|
||||
|
||||
</div>
|
||||
|
||||
|
@ -429,15 +336,15 @@ ul.inheritsList
|
|||
Method Detail
|
||||
</div>
|
||||
|
||||
<a name="addEqualityTester"> </a>
|
||||
<a name="addReporter"> </a>
|
||||
<div class="fixedFont">
|
||||
|
||||
|
||||
<b>addEqualityTester</b>(equalityTester)
|
||||
<b>addReporter</b>(reporter)
|
||||
|
||||
</div>
|
||||
<div class="description">
|
||||
|
||||
Register a reporter to receive status updates from Jasmine.
|
||||
|
||||
|
||||
</div>
|
||||
|
@ -449,450 +356,10 @@ ul.inheritsList
|
|||
<dt class="heading">Parameters:</dt>
|
||||
|
||||
<dt>
|
||||
<b>equalityTester</b>
|
||||
<span class="light fixedFont">{<a href="../symbols/jasmine.Reporter.html">jasmine.Reporter</a>}</span> <b>reporter</b>
|
||||
|
||||
</dt>
|
||||
<dd></dd>
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<hr />
|
||||
|
||||
<a name="afterEach"> </a>
|
||||
<div class="fixedFont">
|
||||
|
||||
|
||||
<b>afterEach</b>(afterEachFunction)
|
||||
|
||||
</div>
|
||||
<div class="description">
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="detailList">
|
||||
<dt class="heading">Parameters:</dt>
|
||||
|
||||
<dt>
|
||||
<b>afterEachFunction</b>
|
||||
|
||||
</dt>
|
||||
<dd></dd>
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<hr />
|
||||
|
||||
<a name="beforeEach"> </a>
|
||||
<div class="fixedFont">
|
||||
|
||||
|
||||
<b>beforeEach</b>(beforeEachFunction)
|
||||
|
||||
</div>
|
||||
<div class="description">
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="detailList">
|
||||
<dt class="heading">Parameters:</dt>
|
||||
|
||||
<dt>
|
||||
<b>beforeEachFunction</b>
|
||||
|
||||
</dt>
|
||||
<dd></dd>
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<hr />
|
||||
|
||||
<a name="compareObjects_"> </a>
|
||||
<div class="fixedFont">
|
||||
|
||||
|
||||
<b>compareObjects_</b>(a, b, mismatchKeys, mismatchValues)
|
||||
|
||||
</div>
|
||||
<div class="description">
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="detailList">
|
||||
<dt class="heading">Parameters:</dt>
|
||||
|
||||
<dt>
|
||||
<b>a</b>
|
||||
|
||||
</dt>
|
||||
<dd></dd>
|
||||
|
||||
<dt>
|
||||
<b>b</b>
|
||||
|
||||
</dt>
|
||||
<dd></dd>
|
||||
|
||||
<dt>
|
||||
<b>mismatchKeys</b>
|
||||
|
||||
</dt>
|
||||
<dd></dd>
|
||||
|
||||
<dt>
|
||||
<b>mismatchValues</b>
|
||||
|
||||
</dt>
|
||||
<dd></dd>
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<hr />
|
||||
|
||||
<a name="contains_"> </a>
|
||||
<div class="fixedFont">
|
||||
|
||||
|
||||
<b>contains_</b>(haystack, needle)
|
||||
|
||||
</div>
|
||||
<div class="description">
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="detailList">
|
||||
<dt class="heading">Parameters:</dt>
|
||||
|
||||
<dt>
|
||||
<b>haystack</b>
|
||||
|
||||
</dt>
|
||||
<dd></dd>
|
||||
|
||||
<dt>
|
||||
<b>needle</b>
|
||||
|
||||
</dt>
|
||||
<dd></dd>
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<hr />
|
||||
|
||||
<a name="describe"> </a>
|
||||
<div class="fixedFont">
|
||||
|
||||
|
||||
<b>describe</b>(description, specDefinitions)
|
||||
|
||||
</div>
|
||||
<div class="description">
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="detailList">
|
||||
<dt class="heading">Parameters:</dt>
|
||||
|
||||
<dt>
|
||||
<b>description</b>
|
||||
|
||||
</dt>
|
||||
<dd></dd>
|
||||
|
||||
<dt>
|
||||
<b>specDefinitions</b>
|
||||
|
||||
</dt>
|
||||
<dd></dd>
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<hr />
|
||||
|
||||
<a name="equals_"> </a>
|
||||
<div class="fixedFont">
|
||||
|
||||
|
||||
<b>equals_</b>(a, b, mismatchKeys, mismatchValues)
|
||||
|
||||
</div>
|
||||
<div class="description">
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="detailList">
|
||||
<dt class="heading">Parameters:</dt>
|
||||
|
||||
<dt>
|
||||
<b>a</b>
|
||||
|
||||
</dt>
|
||||
<dd></dd>
|
||||
|
||||
<dt>
|
||||
<b>b</b>
|
||||
|
||||
</dt>
|
||||
<dd></dd>
|
||||
|
||||
<dt>
|
||||
<b>mismatchKeys</b>
|
||||
|
||||
</dt>
|
||||
<dd></dd>
|
||||
|
||||
<dt>
|
||||
<b>mismatchValues</b>
|
||||
|
||||
</dt>
|
||||
<dd></dd>
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<hr />
|
||||
|
||||
<a name="execute"> </a>
|
||||
<div class="fixedFont">
|
||||
|
||||
|
||||
<b>execute</b>()
|
||||
|
||||
</div>
|
||||
<div class="description">
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<hr />
|
||||
|
||||
<a name="it"> </a>
|
||||
<div class="fixedFont">
|
||||
|
||||
|
||||
<b>it</b>(description, func)
|
||||
|
||||
</div>
|
||||
<div class="description">
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="detailList">
|
||||
<dt class="heading">Parameters:</dt>
|
||||
|
||||
<dt>
|
||||
<b>description</b>
|
||||
|
||||
</dt>
|
||||
<dd></dd>
|
||||
|
||||
<dt>
|
||||
<b>func</b>
|
||||
|
||||
</dt>
|
||||
<dd></dd>
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<hr />
|
||||
|
||||
<a name="specFilter"> </a>
|
||||
<div class="fixedFont">
|
||||
|
||||
|
||||
<b>specFilter</b>()
|
||||
|
||||
</div>
|
||||
<div class="description">
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<hr />
|
||||
|
||||
<a name="xdescribe"> </a>
|
||||
<div class="fixedFont">
|
||||
|
||||
|
||||
<b>xdescribe</b>(desc, specDefinitions)
|
||||
|
||||
</div>
|
||||
<div class="description">
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="detailList">
|
||||
<dt class="heading">Parameters:</dt>
|
||||
|
||||
<dt>
|
||||
<b>desc</b>
|
||||
|
||||
</dt>
|
||||
<dd></dd>
|
||||
|
||||
<dt>
|
||||
<b>specDefinitions</b>
|
||||
|
||||
</dt>
|
||||
<dd></dd>
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<hr />
|
||||
|
||||
<a name="xit"> </a>
|
||||
<div class="fixedFont">
|
||||
|
||||
|
||||
<b>xit</b>(desc, func)
|
||||
|
||||
</div>
|
||||
<div class="description">
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="detailList">
|
||||
<dt class="heading">Parameters:</dt>
|
||||
|
||||
<dt>
|
||||
<b>desc</b>
|
||||
|
||||
</dt>
|
||||
<dd></dd>
|
||||
|
||||
<dt>
|
||||
<b>func</b>
|
||||
|
||||
</dt>
|
||||
<dd></dd>
|
||||
<dd>An object which will receive status updates.</dd>
|
||||
|
||||
</dl>
|
||||
|
||||
|
@ -917,7 +384,7 @@ ul.inheritsList
|
|||
<!-- ============================== footer ================================= -->
|
||||
<div class="fineprint" style="clear:both">
|
||||
|
||||
Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.3.0 on Sun Jun 28 2009 09:15:39 GMT-0700 (PDT)
|
||||
Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.3.0 on Thu Jul 09 2009 21:42:19 GMT-0700 (PDT)
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -0,0 +1,322 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
<meta name="generator" content="JsDoc Toolkit" />
|
||||
|
||||
<title>JsDoc Reference - jasmine.MultiReporter</title>
|
||||
|
||||
<style type="text/css">
|
||||
/* default.css */
|
||||
body
|
||||
{
|
||||
font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif;
|
||||
width: 800px;
|
||||
}
|
||||
|
||||
.header
|
||||
{
|
||||
clear: both;
|
||||
background-color: #ccc;
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
h1
|
||||
{
|
||||
font-size: 150%;
|
||||
font-weight: bold;
|
||||
padding: 0;
|
||||
margin: 1em 0 0 .3em;
|
||||
}
|
||||
|
||||
hr
|
||||
{
|
||||
border: none 0;
|
||||
border-top: 1px solid #7F8FB1;
|
||||
height: 1px;
|
||||
}
|
||||
|
||||
pre.code
|
||||
{
|
||||
display: block;
|
||||
padding: 8px;
|
||||
border: 1px dashed #ccc;
|
||||
}
|
||||
|
||||
#index
|
||||
{
|
||||
margin-top: 24px;
|
||||
float: left;
|
||||
width: 160px;
|
||||
position: absolute;
|
||||
left: 8px;
|
||||
background-color: #F3F3F3;
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
#content
|
||||
{
|
||||
margin-left: 190px;
|
||||
width: 600px;
|
||||
}
|
||||
|
||||
.classList
|
||||
{
|
||||
list-style-type: none;
|
||||
padding: 0;
|
||||
margin: 0 0 0 8px;
|
||||
font-family: arial, sans-serif;
|
||||
font-size: 1em;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.classList li
|
||||
{
|
||||
padding: 0;
|
||||
margin: 0 0 8px 0;
|
||||
}
|
||||
|
||||
.summaryTable { width: 100%; }
|
||||
|
||||
h1.classTitle
|
||||
{
|
||||
font-size:170%;
|
||||
line-height:130%;
|
||||
}
|
||||
|
||||
h2 { font-size: 110%; }
|
||||
caption, div.sectionTitle
|
||||
{
|
||||
background-color: #7F8FB1;
|
||||
color: #fff;
|
||||
font-size:130%;
|
||||
text-align: left;
|
||||
padding: 2px 6px 2px 6px;
|
||||
border: 1px #7F8FB1 solid;
|
||||
}
|
||||
|
||||
div.sectionTitle { margin-bottom: 8px; }
|
||||
.summaryTable thead { display: none; }
|
||||
|
||||
.summaryTable td
|
||||
{
|
||||
vertical-align: top;
|
||||
padding: 4px;
|
||||
border-bottom: 1px #7F8FB1 solid;
|
||||
border-right: 1px #7F8FB1 solid;
|
||||
}
|
||||
|
||||
/*col#summaryAttributes {}*/
|
||||
.summaryTable td.attributes
|
||||
{
|
||||
border-left: 1px #7F8FB1 solid;
|
||||
width: 140px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
td.attributes, .fixedFont
|
||||
{
|
||||
line-height: 15px;
|
||||
color: #002EBE;
|
||||
font-family: "Courier New",Courier,monospace;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.summaryTable td.nameDescription
|
||||
{
|
||||
text-align: left;
|
||||
font-size: 13px;
|
||||
line-height: 15px;
|
||||
}
|
||||
|
||||
.summaryTable td.nameDescription, .description
|
||||
{
|
||||
line-height: 15px;
|
||||
padding: 4px;
|
||||
padding-left: 4px;
|
||||
}
|
||||
|
||||
.summaryTable { margin-bottom: 8px; }
|
||||
|
||||
ul.inheritsList
|
||||
{
|
||||
list-style: square;
|
||||
margin-left: 20px;
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
.detailList {
|
||||
margin-left: 20px;
|
||||
line-height: 15px;
|
||||
}
|
||||
.detailList dt { margin-left: 20px; }
|
||||
|
||||
.detailList .heading
|
||||
{
|
||||
font-weight: bold;
|
||||
padding-bottom: 6px;
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.light, td.attributes, .light a:link, .light a:visited
|
||||
{
|
||||
color: #777;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.fineprint
|
||||
{
|
||||
text-align: right;
|
||||
font-size: 10px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<!-- ============================== header ================================= -->
|
||||
<!-- begin static/header.html -->
|
||||
<div id="header">
|
||||
</div>
|
||||
<!-- end static/header.html -->
|
||||
|
||||
<!-- ============================== classes index ============================ -->
|
||||
<div id="index">
|
||||
<!-- begin publish.classesIndex -->
|
||||
<div align="center"><a href="../index.html">Class Index</a>
|
||||
| <a href="../files.html">File Index</a></div>
|
||||
<hr />
|
||||
<h2>Classes</h2>
|
||||
<ul class="classList">
|
||||
|
||||
<li><i><a href="../symbols/_global_.html">_global_</a></i></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.html">jasmine</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.ActionCollection.html">jasmine.ActionCollection</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Env.html">jasmine.Env</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.MultiReporter.html">jasmine.MultiReporter</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.NestedResults.html">jasmine.NestedResults</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.QueuedFunction.html">jasmine.QueuedFunction</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Reporter.html">jasmine.Reporter</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Runner.html">jasmine.Runner</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Spec.html">jasmine.Spec</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Spy.html">jasmine.Spy</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Suite.html">jasmine.Suite</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.util.html">jasmine.util</a></li>
|
||||
|
||||
</ul>
|
||||
<hr />
|
||||
<!-- end publish.classesIndex -->
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
<!-- ============================== class title ============================ -->
|
||||
<h1 class="classTitle">
|
||||
|
||||
Class jasmine.MultiReporter
|
||||
</h1>
|
||||
|
||||
<!-- ============================== class summary ========================== -->
|
||||
<p class="description">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<br /><i>Defined in: </i> <a href="../symbols/src/lib_jasmine.js.html">jasmine.js</a>.
|
||||
|
||||
</p>
|
||||
|
||||
<!-- ============================== constructor summary ==================== -->
|
||||
|
||||
<table class="summaryTable" cellspacing="0" summary="A summary of the constructor documented in the class jasmine.MultiReporter.">
|
||||
<caption>Class Summary</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Constructor Attributes</th>
|
||||
<th scope="col">Constructor Name and Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="attributes"> </td>
|
||||
<td class="nameDescription" >
|
||||
<div class="fixedFont">
|
||||
<b><a href="../symbols/jasmine.MultiReporter.html#constructor">jasmine.MultiReporter</a></b>()
|
||||
</div>
|
||||
<div class="description"></div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
<!-- ============================== properties summary ===================== -->
|
||||
|
||||
|
||||
<!-- ============================== methods summary ======================== -->
|
||||
|
||||
<!-- ============================== events summary ======================== -->
|
||||
|
||||
|
||||
<!-- ============================== constructor details ==================== -->
|
||||
|
||||
<div class="details"><a name="constructor"> </a>
|
||||
<div class="sectionTitle">
|
||||
Class Detail
|
||||
</div>
|
||||
|
||||
<div class="fixedFont">
|
||||
<b>jasmine.MultiReporter</b>()
|
||||
</div>
|
||||
|
||||
<div class="description">
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<!-- ============================== field details ========================== -->
|
||||
|
||||
|
||||
<!-- ============================== method details ========================= -->
|
||||
|
||||
|
||||
<!-- ============================== event details ========================= -->
|
||||
|
||||
|
||||
<hr />
|
||||
</div>
|
||||
|
||||
|
||||
<!-- ============================== footer ================================= -->
|
||||
<div class="fineprint" style="clear:both">
|
||||
|
||||
Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.3.0 on Thu Jul 09 2009 21:42:19 GMT-0700 (PDT)
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -195,12 +195,20 @@ ul.inheritsList
|
|||
|
||||
<li><a href="../symbols/jasmine.ActionCollection.html">jasmine.ActionCollection</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Env.html">jasmine.Env</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.MultiReporter.html">jasmine.MultiReporter</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.NestedResults.html">jasmine.NestedResults</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.QueuedFunction.html">jasmine.QueuedFunction</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Reporter.html">jasmine.Reporter</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Runner.html">jasmine.Runner</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Spec.html">jasmine.Spec</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Spy.html">jasmine.Spy</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Suite.html">jasmine.Suite</a></li>
|
||||
|
@ -226,7 +234,7 @@ ul.inheritsList
|
|||
|
||||
|
||||
|
||||
<br /><i>Defined in: </i> <a href="../symbols/src/src_NestedResults.js.html">NestedResults.js</a>.
|
||||
<br /><i>Defined in: </i> <a href="../symbols/src/lib_jasmine.js.html">jasmine.js</a>.
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -535,7 +543,7 @@ ul.inheritsList
|
|||
<dt class="heading">Parameters:</dt>
|
||||
|
||||
<dt>
|
||||
<span class="light fixedFont">{<a href="../symbols/jasmine.html#.ExpectationResult">jasmine.ExpectationResult</a>|<a href="../symbols/jasmine.NestedResults.html">jasmine.NestedResults</a>}</span> <b>result</b>
|
||||
<span class="light fixedFont">{jasmine.ExpectationResult|<a href="../symbols/jasmine.NestedResults.html">jasmine.NestedResults</a>}</span> <b>result</b>
|
||||
|
||||
</dt>
|
||||
<dd></dd>
|
||||
|
@ -692,7 +700,7 @@ ul.inheritsList
|
|||
<!-- ============================== footer ================================= -->
|
||||
<div class="fineprint" style="clear:both">
|
||||
|
||||
Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.3.0 on Sun Jun 28 2009 13:34:06 GMT-0700 (PDT)
|
||||
Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.3.0 on Thu Jul 09 2009 21:42:19 GMT-0700 (PDT)
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -195,12 +195,20 @@ ul.inheritsList
|
|||
|
||||
<li><a href="../symbols/jasmine.ActionCollection.html">jasmine.ActionCollection</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Env.html">jasmine.Env</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.MultiReporter.html">jasmine.MultiReporter</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.NestedResults.html">jasmine.NestedResults</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.QueuedFunction.html">jasmine.QueuedFunction</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Reporter.html">jasmine.Reporter</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Runner.html">jasmine.Runner</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Spec.html">jasmine.Spec</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Spy.html">jasmine.Spy</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Suite.html">jasmine.Suite</a></li>
|
||||
|
@ -226,7 +234,7 @@ ul.inheritsList
|
|||
|
||||
|
||||
|
||||
<br /><i>Defined in: </i> <a href="../symbols/src/src_QueuedFunction.js.html">QueuedFunction.js</a>.
|
||||
<br /><i>Defined in: </i> <a href="../symbols/src/lib_jasmine.js.html">jasmine.js</a>.
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -259,60 +267,6 @@ ul.inheritsList
|
|||
|
||||
<!-- ============================== methods summary ======================== -->
|
||||
|
||||
|
||||
|
||||
<table class="summaryTable" cellspacing="0" summary="A summary of the methods documented in the class jasmine.QueuedFunction.">
|
||||
<caption>Method Summary</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Method Attributes</th>
|
||||
<th scope="col">Method Name and Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<tr>
|
||||
<td class="attributes"> </td>
|
||||
<td class="nameDescription">
|
||||
<div class="fixedFont"><b><a href="../symbols/jasmine.QueuedFunction.html#execute">execute</a></b>()
|
||||
</div>
|
||||
<div class="description"></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="attributes"> </td>
|
||||
<td class="nameDescription">
|
||||
<div class="fixedFont"><b><a href="../symbols/jasmine.QueuedFunction.html#fail">fail</a></b>(e)
|
||||
</div>
|
||||
<div class="description"></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="attributes"> </td>
|
||||
<td class="nameDescription">
|
||||
<div class="fixedFont"><b><a href="../symbols/jasmine.QueuedFunction.html#next">next</a></b>()
|
||||
</div>
|
||||
<div class="description"></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="attributes"> </td>
|
||||
<td class="nameDescription">
|
||||
<div class="fixedFont"><b><a href="../symbols/jasmine.QueuedFunction.html#safeExecute">safeExecute</a></b>()
|
||||
</div>
|
||||
<div class="description"></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- ============================== events summary ======================== -->
|
||||
|
||||
|
||||
|
@ -340,7 +294,7 @@ ul.inheritsList
|
|||
<dt class="heading">Parameters:</dt>
|
||||
|
||||
<dt>
|
||||
<span class="light fixedFont">{<a href="../symbols/jasmine.html#.Env">jasmine.Env</a>}</span> <b>env</b>
|
||||
<span class="light fixedFont">{<a href="../symbols/jasmine.Env.html">jasmine.Env</a>}</span> <b>env</b>
|
||||
|
||||
</dt>
|
||||
<dd></dd>
|
||||
|
@ -364,7 +318,7 @@ ul.inheritsList
|
|||
<dd></dd>
|
||||
|
||||
<dt>
|
||||
<span class="light fixedFont">{jasmine.Spec}</span> <b>spec</b>
|
||||
<span class="light fixedFont">{<a href="../symbols/jasmine.Spec.html">jasmine.Spec</a>}</span> <b>spec</b>
|
||||
|
||||
</dt>
|
||||
<dd></dd>
|
||||
|
@ -386,122 +340,6 @@ ul.inheritsList
|
|||
|
||||
<!-- ============================== method details ========================= -->
|
||||
|
||||
<div class="sectionTitle">
|
||||
Method Detail
|
||||
</div>
|
||||
|
||||
<a name="execute"> </a>
|
||||
<div class="fixedFont">
|
||||
|
||||
|
||||
<b>execute</b>()
|
||||
|
||||
</div>
|
||||
<div class="description">
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<hr />
|
||||
|
||||
<a name="fail"> </a>
|
||||
<div class="fixedFont">
|
||||
|
||||
|
||||
<b>fail</b>(e)
|
||||
|
||||
</div>
|
||||
<div class="description">
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="detailList">
|
||||
<dt class="heading">Parameters:</dt>
|
||||
|
||||
<dt>
|
||||
<b>e</b>
|
||||
|
||||
</dt>
|
||||
<dd></dd>
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<hr />
|
||||
|
||||
<a name="next"> </a>
|
||||
<div class="fixedFont">
|
||||
|
||||
|
||||
<b>next</b>()
|
||||
|
||||
</div>
|
||||
<div class="description">
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<hr />
|
||||
|
||||
<a name="safeExecute"> </a>
|
||||
<div class="fixedFont">
|
||||
|
||||
|
||||
<b>safeExecute</b>()
|
||||
|
||||
</div>
|
||||
<div class="description">
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- ============================== event details ========================= -->
|
||||
|
||||
|
@ -513,7 +351,7 @@ ul.inheritsList
|
|||
<!-- ============================== footer ================================= -->
|
||||
<div class="fineprint" style="clear:both">
|
||||
|
||||
Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.3.0 on Sun Jun 28 2009 13:34:06 GMT-0700 (PDT)
|
||||
Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.3.0 on Thu Jul 09 2009 21:42:19 GMT-0700 (PDT)
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -0,0 +1,322 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
<meta name="generator" content="JsDoc Toolkit" />
|
||||
|
||||
<title>JsDoc Reference - jasmine.Reporter</title>
|
||||
|
||||
<style type="text/css">
|
||||
/* default.css */
|
||||
body
|
||||
{
|
||||
font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif;
|
||||
width: 800px;
|
||||
}
|
||||
|
||||
.header
|
||||
{
|
||||
clear: both;
|
||||
background-color: #ccc;
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
h1
|
||||
{
|
||||
font-size: 150%;
|
||||
font-weight: bold;
|
||||
padding: 0;
|
||||
margin: 1em 0 0 .3em;
|
||||
}
|
||||
|
||||
hr
|
||||
{
|
||||
border: none 0;
|
||||
border-top: 1px solid #7F8FB1;
|
||||
height: 1px;
|
||||
}
|
||||
|
||||
pre.code
|
||||
{
|
||||
display: block;
|
||||
padding: 8px;
|
||||
border: 1px dashed #ccc;
|
||||
}
|
||||
|
||||
#index
|
||||
{
|
||||
margin-top: 24px;
|
||||
float: left;
|
||||
width: 160px;
|
||||
position: absolute;
|
||||
left: 8px;
|
||||
background-color: #F3F3F3;
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
#content
|
||||
{
|
||||
margin-left: 190px;
|
||||
width: 600px;
|
||||
}
|
||||
|
||||
.classList
|
||||
{
|
||||
list-style-type: none;
|
||||
padding: 0;
|
||||
margin: 0 0 0 8px;
|
||||
font-family: arial, sans-serif;
|
||||
font-size: 1em;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.classList li
|
||||
{
|
||||
padding: 0;
|
||||
margin: 0 0 8px 0;
|
||||
}
|
||||
|
||||
.summaryTable { width: 100%; }
|
||||
|
||||
h1.classTitle
|
||||
{
|
||||
font-size:170%;
|
||||
line-height:130%;
|
||||
}
|
||||
|
||||
h2 { font-size: 110%; }
|
||||
caption, div.sectionTitle
|
||||
{
|
||||
background-color: #7F8FB1;
|
||||
color: #fff;
|
||||
font-size:130%;
|
||||
text-align: left;
|
||||
padding: 2px 6px 2px 6px;
|
||||
border: 1px #7F8FB1 solid;
|
||||
}
|
||||
|
||||
div.sectionTitle { margin-bottom: 8px; }
|
||||
.summaryTable thead { display: none; }
|
||||
|
||||
.summaryTable td
|
||||
{
|
||||
vertical-align: top;
|
||||
padding: 4px;
|
||||
border-bottom: 1px #7F8FB1 solid;
|
||||
border-right: 1px #7F8FB1 solid;
|
||||
}
|
||||
|
||||
/*col#summaryAttributes {}*/
|
||||
.summaryTable td.attributes
|
||||
{
|
||||
border-left: 1px #7F8FB1 solid;
|
||||
width: 140px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
td.attributes, .fixedFont
|
||||
{
|
||||
line-height: 15px;
|
||||
color: #002EBE;
|
||||
font-family: "Courier New",Courier,monospace;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.summaryTable td.nameDescription
|
||||
{
|
||||
text-align: left;
|
||||
font-size: 13px;
|
||||
line-height: 15px;
|
||||
}
|
||||
|
||||
.summaryTable td.nameDescription, .description
|
||||
{
|
||||
line-height: 15px;
|
||||
padding: 4px;
|
||||
padding-left: 4px;
|
||||
}
|
||||
|
||||
.summaryTable { margin-bottom: 8px; }
|
||||
|
||||
ul.inheritsList
|
||||
{
|
||||
list-style: square;
|
||||
margin-left: 20px;
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
.detailList {
|
||||
margin-left: 20px;
|
||||
line-height: 15px;
|
||||
}
|
||||
.detailList dt { margin-left: 20px; }
|
||||
|
||||
.detailList .heading
|
||||
{
|
||||
font-weight: bold;
|
||||
padding-bottom: 6px;
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.light, td.attributes, .light a:link, .light a:visited
|
||||
{
|
||||
color: #777;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.fineprint
|
||||
{
|
||||
text-align: right;
|
||||
font-size: 10px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<!-- ============================== header ================================= -->
|
||||
<!-- begin static/header.html -->
|
||||
<div id="header">
|
||||
</div>
|
||||
<!-- end static/header.html -->
|
||||
|
||||
<!-- ============================== classes index ============================ -->
|
||||
<div id="index">
|
||||
<!-- begin publish.classesIndex -->
|
||||
<div align="center"><a href="../index.html">Class Index</a>
|
||||
| <a href="../files.html">File Index</a></div>
|
||||
<hr />
|
||||
<h2>Classes</h2>
|
||||
<ul class="classList">
|
||||
|
||||
<li><i><a href="../symbols/_global_.html">_global_</a></i></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.html">jasmine</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.ActionCollection.html">jasmine.ActionCollection</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Env.html">jasmine.Env</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.MultiReporter.html">jasmine.MultiReporter</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.NestedResults.html">jasmine.NestedResults</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.QueuedFunction.html">jasmine.QueuedFunction</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Reporter.html">jasmine.Reporter</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Runner.html">jasmine.Runner</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Spec.html">jasmine.Spec</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Spy.html">jasmine.Spy</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Suite.html">jasmine.Suite</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.util.html">jasmine.util</a></li>
|
||||
|
||||
</ul>
|
||||
<hr />
|
||||
<!-- end publish.classesIndex -->
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
<!-- ============================== class title ============================ -->
|
||||
<h1 class="classTitle">
|
||||
|
||||
Class jasmine.Reporter
|
||||
</h1>
|
||||
|
||||
<!-- ============================== class summary ========================== -->
|
||||
<p class="description">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<br /><i>Defined in: </i> <a href="../symbols/src/lib_jasmine.js.html">jasmine.js</a>.
|
||||
|
||||
</p>
|
||||
|
||||
<!-- ============================== constructor summary ==================== -->
|
||||
|
||||
<table class="summaryTable" cellspacing="0" summary="A summary of the constructor documented in the class jasmine.Reporter.">
|
||||
<caption>Class Summary</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Constructor Attributes</th>
|
||||
<th scope="col">Constructor Name and Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="attributes"> </td>
|
||||
<td class="nameDescription" >
|
||||
<div class="fixedFont">
|
||||
<b><a href="../symbols/jasmine.Reporter.html#constructor">jasmine.Reporter</a></b>()
|
||||
</div>
|
||||
<div class="description">No-op base class for Jasmine reporters.</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
<!-- ============================== properties summary ===================== -->
|
||||
|
||||
|
||||
<!-- ============================== methods summary ======================== -->
|
||||
|
||||
<!-- ============================== events summary ======================== -->
|
||||
|
||||
|
||||
<!-- ============================== constructor details ==================== -->
|
||||
|
||||
<div class="details"><a name="constructor"> </a>
|
||||
<div class="sectionTitle">
|
||||
Class Detail
|
||||
</div>
|
||||
|
||||
<div class="fixedFont">
|
||||
<b>jasmine.Reporter</b>()
|
||||
</div>
|
||||
|
||||
<div class="description">
|
||||
No-op base class for Jasmine reporters.
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<!-- ============================== field details ========================== -->
|
||||
|
||||
|
||||
<!-- ============================== method details ========================= -->
|
||||
|
||||
|
||||
<!-- ============================== event details ========================= -->
|
||||
|
||||
|
||||
<hr />
|
||||
</div>
|
||||
|
||||
|
||||
<!-- ============================== footer ================================= -->
|
||||
<div class="fineprint" style="clear:both">
|
||||
|
||||
Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.3.0 on Thu Jul 09 2009 21:42:19 GMT-0700 (PDT)
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -195,12 +195,20 @@ ul.inheritsList
|
|||
|
||||
<li><a href="../symbols/jasmine.ActionCollection.html">jasmine.ActionCollection</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Env.html">jasmine.Env</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.MultiReporter.html">jasmine.MultiReporter</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.NestedResults.html">jasmine.NestedResults</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.QueuedFunction.html">jasmine.QueuedFunction</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Reporter.html">jasmine.Reporter</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Runner.html">jasmine.Runner</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Spec.html">jasmine.Spec</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Spy.html">jasmine.Spy</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Suite.html">jasmine.Suite</a></li>
|
||||
|
@ -226,7 +234,7 @@ ul.inheritsList
|
|||
|
||||
|
||||
|
||||
<br /><i>Defined in: </i> <a href="../symbols/src/src_Runner.js.html">Runner.js</a>.
|
||||
<br /><i>Defined in: </i> <a href="../symbols/src/lib_jasmine.js.html">jasmine.js</a>.
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -259,42 +267,6 @@ ul.inheritsList
|
|||
|
||||
<!-- ============================== methods summary ======================== -->
|
||||
|
||||
|
||||
|
||||
<table class="summaryTable" cellspacing="0" summary="A summary of the methods documented in the class jasmine.Runner.">
|
||||
<caption>Method Summary</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Method Attributes</th>
|
||||
<th scope="col">Method Name and Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<tr>
|
||||
<td class="attributes"> </td>
|
||||
<td class="nameDescription">
|
||||
<div class="fixedFont"><b><a href="../symbols/jasmine.Runner.html#finishCallback">finishCallback</a></b>()
|
||||
</div>
|
||||
<div class="description"></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="attributes"> </td>
|
||||
<td class="nameDescription">
|
||||
<div class="fixedFont"><b><a href="../symbols/jasmine.Runner.html#getResults">getResults</a></b>()
|
||||
</div>
|
||||
<div class="description"></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- ============================== events summary ======================== -->
|
||||
|
||||
|
||||
|
@ -322,7 +294,7 @@ ul.inheritsList
|
|||
<dt class="heading">Parameters:</dt>
|
||||
|
||||
<dt>
|
||||
<span class="light fixedFont">{<a href="../symbols/jasmine.html#.Env">jasmine.Env</a>}</span> <b>env</b>
|
||||
<span class="light fixedFont">{<a href="../symbols/jasmine.Env.html">jasmine.Env</a>}</span> <b>env</b>
|
||||
|
||||
</dt>
|
||||
<dd></dd>
|
||||
|
@ -344,61 +316,6 @@ ul.inheritsList
|
|||
|
||||
<!-- ============================== method details ========================= -->
|
||||
|
||||
<div class="sectionTitle">
|
||||
Method Detail
|
||||
</div>
|
||||
|
||||
<a name="finishCallback"> </a>
|
||||
<div class="fixedFont">
|
||||
|
||||
|
||||
<b>finishCallback</b>()
|
||||
|
||||
</div>
|
||||
<div class="description">
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<hr />
|
||||
|
||||
<a name="getResults"> </a>
|
||||
<div class="fixedFont">
|
||||
|
||||
|
||||
<b>getResults</b>()
|
||||
|
||||
</div>
|
||||
<div class="description">
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- ============================== event details ========================= -->
|
||||
|
||||
|
@ -410,7 +327,7 @@ ul.inheritsList
|
|||
<!-- ============================== footer ================================= -->
|
||||
<div class="fineprint" style="clear:both">
|
||||
|
||||
Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.3.0 on Sun Jun 28 2009 13:34:06 GMT-0700 (PDT)
|
||||
Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.3.0 on Thu Jul 09 2009 21:42:19 GMT-0700 (PDT)
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -197,14 +197,20 @@ ul.inheritsList
|
|||
|
||||
<li><a href="../symbols/jasmine.Env.html">jasmine.Env</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.MultiReporter.html">jasmine.MultiReporter</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.NestedResults.html">jasmine.NestedResults</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.QueuedFunction.html">jasmine.QueuedFunction</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Reporter.html">jasmine.Reporter</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Runner.html">jasmine.Runner</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Spec.html">jasmine.Spec</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Spy.html">jasmine.Spy</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Suite.html">jasmine.Suite</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.util.html">jasmine.util</a></li>
|
||||
|
@ -228,7 +234,7 @@ ul.inheritsList
|
|||
|
||||
|
||||
|
||||
<br /><i>Defined in: </i> <a href="../symbols/src/src_Spec.js.html">Spec.js</a>.
|
||||
<br /><i>Defined in: </i> <a href="../symbols/src/lib_jasmine.js.html">jasmine.js</a>.
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -247,9 +253,9 @@ ul.inheritsList
|
|||
<td class="attributes"> </td>
|
||||
<td class="nameDescription" >
|
||||
<div class="fixedFont">
|
||||
<b><a href="../symbols/jasmine.Spec.html#constructor">jasmine.Spec</a></b>(env, description, description)
|
||||
<b><a href="../symbols/jasmine.Spec.html#constructor">jasmine.Spec</a></b>(env, suite, description)
|
||||
</div>
|
||||
<div class="description">Spec</div>
|
||||
<div class="description">Internal representation of a Jasmine specification, or test.</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -261,33 +267,6 @@ ul.inheritsList
|
|||
|
||||
<!-- ============================== methods summary ======================== -->
|
||||
|
||||
|
||||
|
||||
<table class="summaryTable" cellspacing="0" summary="A summary of the methods documented in the class jasmine.Spec.">
|
||||
<caption>Method Summary</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Method Attributes</th>
|
||||
<th scope="col">Method Name and Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<tr>
|
||||
<td class="attributes"> </td>
|
||||
<td class="nameDescription">
|
||||
<div class="fixedFont"><b><a href="../symbols/jasmine.Spec.html#expects_that">expects_that</a></b>(actual)
|
||||
</div>
|
||||
<div class="description"></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- ============================== events summary ======================== -->
|
||||
|
||||
|
||||
|
@ -299,11 +278,11 @@ ul.inheritsList
|
|||
</div>
|
||||
|
||||
<div class="fixedFont">
|
||||
<b>jasmine.Spec</b>(env, description, description)
|
||||
<b>jasmine.Spec</b>(env, suite, description)
|
||||
</div>
|
||||
|
||||
<div class="description">
|
||||
Spec
|
||||
Internal representation of a Jasmine specification, or test.
|
||||
|
||||
</div>
|
||||
|
||||
|
@ -321,13 +300,13 @@ ul.inheritsList
|
|||
<dd></dd>
|
||||
|
||||
<dt>
|
||||
<span class="light fixedFont">{String}</span> <b>description</b>
|
||||
<span class="light fixedFont">{<a href="../symbols/jasmine.Suite.html">jasmine.Suite</a>}</span> <b>suite</b>
|
||||
|
||||
</dt>
|
||||
<dd></dd>
|
||||
|
||||
<dt>
|
||||
<b>description</b>
|
||||
<span class="light fixedFont">{String}</span> <b>description</b>
|
||||
|
||||
</dt>
|
||||
<dd></dd>
|
||||
|
@ -349,47 +328,6 @@ ul.inheritsList
|
|||
|
||||
<!-- ============================== method details ========================= -->
|
||||
|
||||
<div class="sectionTitle">
|
||||
Method Detail
|
||||
</div>
|
||||
|
||||
<a name="expects_that"> </a>
|
||||
<div class="fixedFont">
|
||||
|
||||
|
||||
<b>expects_that</b>(actual)
|
||||
|
||||
</div>
|
||||
<div class="description">
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="detailList">
|
||||
<dt class="heading">Parameters:</dt>
|
||||
|
||||
<dt>
|
||||
<b>actual</b>
|
||||
|
||||
</dt>
|
||||
<dd></dd>
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- ============================== event details ========================= -->
|
||||
|
||||
|
@ -401,7 +339,7 @@ ul.inheritsList
|
|||
<!-- ============================== footer ================================= -->
|
||||
<div class="fineprint" style="clear:both">
|
||||
|
||||
Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.3.0 on Fri Jun 26 2009 08:22:36 GMT-0700 (PDT)
|
||||
Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.3.0 on Thu Jul 09 2009 21:42:19 GMT-0700 (PDT)
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -195,12 +195,20 @@ ul.inheritsList
|
|||
|
||||
<li><a href="../symbols/jasmine.ActionCollection.html">jasmine.ActionCollection</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Env.html">jasmine.Env</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.MultiReporter.html">jasmine.MultiReporter</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.NestedResults.html">jasmine.NestedResults</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.QueuedFunction.html">jasmine.QueuedFunction</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Reporter.html">jasmine.Reporter</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Runner.html">jasmine.Runner</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Spec.html">jasmine.Spec</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Spy.html">jasmine.Spy</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Suite.html">jasmine.Suite</a></li>
|
||||
|
@ -226,7 +234,7 @@ ul.inheritsList
|
|||
|
||||
|
||||
|
||||
<br /><i>Defined in: </i> <a href="../symbols/src/src_base.js.html">base.js</a>.
|
||||
<br /><i>Defined in: </i> <a href="../symbols/src/lib_jasmine.js.html">jasmine.js</a>.
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -837,7 +845,7 @@ expect(foo.bar.callCount).toEqual(0);</pre>
|
|||
<!-- ============================== footer ================================= -->
|
||||
<div class="fineprint" style="clear:both">
|
||||
|
||||
Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.3.0 on Sun Jun 28 2009 13:34:06 GMT-0700 (PDT)
|
||||
Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.3.0 on Thu Jul 09 2009 21:42:19 GMT-0700 (PDT)
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -195,12 +195,20 @@ ul.inheritsList
|
|||
|
||||
<li><a href="../symbols/jasmine.ActionCollection.html">jasmine.ActionCollection</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Env.html">jasmine.Env</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.MultiReporter.html">jasmine.MultiReporter</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.NestedResults.html">jasmine.NestedResults</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.QueuedFunction.html">jasmine.QueuedFunction</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Reporter.html">jasmine.Reporter</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Runner.html">jasmine.Runner</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Spec.html">jasmine.Spec</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Spy.html">jasmine.Spy</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Suite.html">jasmine.Suite</a></li>
|
||||
|
@ -226,7 +234,7 @@ ul.inheritsList
|
|||
|
||||
|
||||
|
||||
<br /><i>Defined in: </i> <a href="../symbols/src/src_Suite.js.html">Suite.js</a>.
|
||||
<br /><i>Defined in: </i> <a href="../symbols/src/lib_jasmine.js.html">jasmine.js</a>.
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -247,7 +255,7 @@ ul.inheritsList
|
|||
<div class="fixedFont">
|
||||
<b><a href="../symbols/jasmine.Suite.html#constructor">jasmine.Suite</a></b>(env, description, specDefinitions, parentSuite)
|
||||
</div>
|
||||
<div class="description">For storing & executing a Jasmine suite.</div>
|
||||
<div class="description">Internal representation of a Jasmine suite.</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -259,69 +267,6 @@ ul.inheritsList
|
|||
|
||||
<!-- ============================== methods summary ======================== -->
|
||||
|
||||
|
||||
|
||||
<table class="summaryTable" cellspacing="0" summary="A summary of the methods documented in the class jasmine.Suite.">
|
||||
<caption>Method Summary</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Method Attributes</th>
|
||||
<th scope="col">Method Name and Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<tr>
|
||||
<td class="attributes"> </td>
|
||||
<td class="nameDescription">
|
||||
<div class="fixedFont"><b><a href="../symbols/jasmine.Suite.html#afterEach">afterEach</a></b>(afterEachFunction)
|
||||
</div>
|
||||
<div class="description"></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="attributes"> </td>
|
||||
<td class="nameDescription">
|
||||
<div class="fixedFont"><b><a href="../symbols/jasmine.Suite.html#beforeEach">beforeEach</a></b>(beforeEachFunction)
|
||||
</div>
|
||||
<div class="description"></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="attributes"> </td>
|
||||
<td class="nameDescription">
|
||||
<div class="fixedFont"><b><a href="../symbols/jasmine.Suite.html#finishCallback">finishCallback</a></b>()
|
||||
</div>
|
||||
<div class="description"></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="attributes"> </td>
|
||||
<td class="nameDescription">
|
||||
<div class="fixedFont"><b><a href="../symbols/jasmine.Suite.html#getFullName">getFullName</a></b>()
|
||||
</div>
|
||||
<div class="description"></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="attributes"> </td>
|
||||
<td class="nameDescription">
|
||||
<div class="fixedFont"><b><a href="../symbols/jasmine.Suite.html#getResults">getResults</a></b>()
|
||||
</div>
|
||||
<div class="description"></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- ============================== events summary ======================== -->
|
||||
|
||||
|
||||
|
@ -337,7 +282,7 @@ ul.inheritsList
|
|||
</div>
|
||||
|
||||
<div class="description">
|
||||
For storing & executing a Jasmine suite.
|
||||
Internal representation of a Jasmine suite.
|
||||
|
||||
</div>
|
||||
|
||||
|
@ -349,7 +294,7 @@ ul.inheritsList
|
|||
<dt class="heading">Parameters:</dt>
|
||||
|
||||
<dt>
|
||||
<span class="light fixedFont">{<a href="../symbols/jasmine.html#.Env">jasmine.Env</a>}</span> <b>env</b>
|
||||
<span class="light fixedFont">{<a href="../symbols/jasmine.Env.html">jasmine.Env</a>}</span> <b>env</b>
|
||||
|
||||
</dt>
|
||||
<dd></dd>
|
||||
|
@ -389,158 +334,6 @@ ul.inheritsList
|
|||
|
||||
<!-- ============================== method details ========================= -->
|
||||
|
||||
<div class="sectionTitle">
|
||||
Method Detail
|
||||
</div>
|
||||
|
||||
<a name="afterEach"> </a>
|
||||
<div class="fixedFont">
|
||||
|
||||
|
||||
<b>afterEach</b>(afterEachFunction)
|
||||
|
||||
</div>
|
||||
<div class="description">
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="detailList">
|
||||
<dt class="heading">Parameters:</dt>
|
||||
|
||||
<dt>
|
||||
<b>afterEachFunction</b>
|
||||
|
||||
</dt>
|
||||
<dd></dd>
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<hr />
|
||||
|
||||
<a name="beforeEach"> </a>
|
||||
<div class="fixedFont">
|
||||
|
||||
|
||||
<b>beforeEach</b>(beforeEachFunction)
|
||||
|
||||
</div>
|
||||
<div class="description">
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="detailList">
|
||||
<dt class="heading">Parameters:</dt>
|
||||
|
||||
<dt>
|
||||
<b>beforeEachFunction</b>
|
||||
|
||||
</dt>
|
||||
<dd></dd>
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<hr />
|
||||
|
||||
<a name="finishCallback"> </a>
|
||||
<div class="fixedFont">
|
||||
|
||||
|
||||
<b>finishCallback</b>()
|
||||
|
||||
</div>
|
||||
<div class="description">
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<hr />
|
||||
|
||||
<a name="getFullName"> </a>
|
||||
<div class="fixedFont">
|
||||
|
||||
|
||||
<b>getFullName</b>()
|
||||
|
||||
</div>
|
||||
<div class="description">
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<hr />
|
||||
|
||||
<a name="getResults"> </a>
|
||||
<div class="fixedFont">
|
||||
|
||||
|
||||
<b>getResults</b>()
|
||||
|
||||
</div>
|
||||
<div class="description">
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- ============================== event details ========================= -->
|
||||
|
||||
|
@ -552,7 +345,7 @@ ul.inheritsList
|
|||
<!-- ============================== footer ================================= -->
|
||||
<div class="fineprint" style="clear:both">
|
||||
|
||||
Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.3.0 on Sun Jun 28 2009 13:34:06 GMT-0700 (PDT)
|
||||
Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.3.0 on Thu Jul 09 2009 21:42:19 GMT-0700 (PDT)
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -195,12 +195,20 @@ ul.inheritsList
|
|||
|
||||
<li><a href="../symbols/jasmine.ActionCollection.html">jasmine.ActionCollection</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Env.html">jasmine.Env</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.MultiReporter.html">jasmine.MultiReporter</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.NestedResults.html">jasmine.NestedResults</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.QueuedFunction.html">jasmine.QueuedFunction</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Reporter.html">jasmine.Reporter</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Runner.html">jasmine.Runner</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Spec.html">jasmine.Spec</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Spy.html">jasmine.Spy</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Suite.html">jasmine.Suite</a></li>
|
||||
|
@ -226,7 +234,7 @@ ul.inheritsList
|
|||
|
||||
|
||||
|
||||
<br /><i>Defined in: </i> <a href="../symbols/src/src_base.js.html">base.js</a>.
|
||||
<br /><i>Defined in: </i> <a href="../symbols/src/lib_jasmine.js.html">jasmine.js</a>.
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -285,15 +293,6 @@ ul.inheritsList
|
|||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="attributes"><static> </td>
|
||||
<td class="nameDescription">
|
||||
<div class="fixedFont">jasmine.<b><a href="../symbols/jasmine.html#.createSpy">createSpy</a></b>(name)
|
||||
</div>
|
||||
<div class="description"></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="attributes"><static> </td>
|
||||
<td class="nameDescription">
|
||||
|
@ -303,33 +302,6 @@ ul.inheritsList
|
|||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="attributes"><static> </td>
|
||||
<td class="nameDescription">
|
||||
<div class="fixedFont">jasmine.<b><a href="../symbols/jasmine.html#.Env">Env</a></b>()
|
||||
</div>
|
||||
<div class="description"></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="attributes"><static> </td>
|
||||
<td class="nameDescription">
|
||||
<div class="fixedFont">jasmine.<b><a href="../symbols/jasmine.html#.ExpectationResult">ExpectationResult</a></b>(passed, message, details)
|
||||
</div>
|
||||
<div class="description"></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="attributes"><static> </td>
|
||||
<td class="nameDescription">
|
||||
<div class="fixedFont">jasmine.<b><a href="../symbols/jasmine.html#.FakeTimer">FakeTimer</a></b>()
|
||||
</div>
|
||||
<div class="description"></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="attributes"><static> </td>
|
||||
<td class="nameDescription">
|
||||
|
@ -358,33 +330,6 @@ Jasmine environment.</div>
|
|||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="attributes"><static> </td>
|
||||
<td class="nameDescription">
|
||||
<div class="fixedFont">jasmine.<b><a href="../symbols/jasmine.html#.log">log</a></b>(message)
|
||||
</div>
|
||||
<div class="description"></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="attributes"><static> </td>
|
||||
<td class="nameDescription">
|
||||
<div class="fixedFont">jasmine.<b><a href="../symbols/jasmine.html#.Matchers">Matchers</a></b>(env, actual, results)
|
||||
</div>
|
||||
<div class="description"></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="attributes"><static> </td>
|
||||
<td class="nameDescription">
|
||||
<div class="fixedFont">jasmine.<b><a href="../symbols/jasmine.html#.MessageResult">MessageResult</a></b>(text)
|
||||
</div>
|
||||
<div class="description"></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="attributes"><static> </td>
|
||||
<td class="nameDescription">
|
||||
|
@ -403,33 +348,6 @@ Jasmine environment.</div>
|
|||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="attributes"><static> </td>
|
||||
<td class="nameDescription">
|
||||
<div class="fixedFont">jasmine.<b><a href="../symbols/jasmine.html#.specFilter">specFilter</a></b>()
|
||||
</div>
|
||||
<div class="description"></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="attributes"><static> </td>
|
||||
<td class="nameDescription">
|
||||
<div class="fixedFont">jasmine.<b><a href="../symbols/jasmine.html#.StringPrettyPrinter">StringPrettyPrinter</a></b>()
|
||||
</div>
|
||||
<div class="description"></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="attributes"><static> </td>
|
||||
<td class="nameDescription">
|
||||
<div class="fixedFont">jasmine.<b><a href="../symbols/jasmine.html#.XmlHttpRequest">XmlHttpRequest</a></b>()
|
||||
</div>
|
||||
<div class="description"></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
@ -524,42 +442,6 @@ expect(mySpy).wasCalledWith(jasmine.any(Function));</pre>
|
|||
|
||||
|
||||
|
||||
<hr />
|
||||
|
||||
<a name=".createSpy"> </a>
|
||||
<div class="fixedFont"><static>
|
||||
|
||||
|
||||
<span class="light">jasmine.</span><b>createSpy</b>(name)
|
||||
|
||||
</div>
|
||||
<div class="description">
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="detailList">
|
||||
<dt class="heading">Parameters:</dt>
|
||||
|
||||
<dt>
|
||||
<b>name</b>
|
||||
|
||||
</dt>
|
||||
<dd></dd>
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<hr />
|
||||
|
||||
<a name=".createSpyObj"> </a>
|
||||
|
@ -603,110 +485,6 @@ large in one call.
|
|||
|
||||
|
||||
|
||||
<hr />
|
||||
|
||||
<a name=".Env"> </a>
|
||||
<div class="fixedFont"><static>
|
||||
|
||||
|
||||
<span class="light">jasmine.</span><b>Env</b>()
|
||||
|
||||
</div>
|
||||
<div class="description">
|
||||
|
||||
|
||||
<br />
|
||||
<i>Defined in: </i> <a href="../symbols/src/src_Env.js.html">Env.js</a>.
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<hr />
|
||||
|
||||
<a name=".ExpectationResult"> </a>
|
||||
<div class="fixedFont"><static>
|
||||
|
||||
|
||||
<span class="light">jasmine.</span><b>ExpectationResult</b>(passed, message, details)
|
||||
|
||||
</div>
|
||||
<div class="description">
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="detailList">
|
||||
<dt class="heading">Parameters:</dt>
|
||||
|
||||
<dt>
|
||||
<b>passed</b>
|
||||
|
||||
</dt>
|
||||
<dd></dd>
|
||||
|
||||
<dt>
|
||||
<b>message</b>
|
||||
|
||||
</dt>
|
||||
<dd></dd>
|
||||
|
||||
<dt>
|
||||
<b>details</b>
|
||||
|
||||
</dt>
|
||||
<dd></dd>
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<hr />
|
||||
|
||||
<a name=".FakeTimer"> </a>
|
||||
<div class="fixedFont"><static>
|
||||
|
||||
|
||||
<span class="light">jasmine.</span><b>FakeTimer</b>()
|
||||
|
||||
</div>
|
||||
<div class="description">
|
||||
|
||||
|
||||
<br />
|
||||
<i>Defined in: </i> <a href="../symbols/src/src_mock-timeout.js.html">mock-timeout.js</a>.
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<hr />
|
||||
|
||||
<a name=".getEnv"> </a>
|
||||
|
@ -818,129 +596,6 @@ Jasmine environment.
|
|||
|
||||
|
||||
|
||||
<hr />
|
||||
|
||||
<a name=".log"> </a>
|
||||
<div class="fixedFont"><static>
|
||||
|
||||
|
||||
<span class="light">jasmine.</span><b>log</b>(message)
|
||||
|
||||
</div>
|
||||
<div class="description">
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="detailList">
|
||||
<dt class="heading">Parameters:</dt>
|
||||
|
||||
<dt>
|
||||
<b>message</b>
|
||||
|
||||
</dt>
|
||||
<dd></dd>
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<hr />
|
||||
|
||||
<a name=".Matchers"> </a>
|
||||
<div class="fixedFont"><static>
|
||||
|
||||
|
||||
<span class="light">jasmine.</span><b>Matchers</b>(env, actual, results)
|
||||
|
||||
</div>
|
||||
<div class="description">
|
||||
|
||||
|
||||
<br />
|
||||
<i>Defined in: </i> <a href="../symbols/src/src_Matchers.js.html">Matchers.js</a>.
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="detailList">
|
||||
<dt class="heading">Parameters:</dt>
|
||||
|
||||
<dt>
|
||||
<b>env</b>
|
||||
|
||||
</dt>
|
||||
<dd></dd>
|
||||
|
||||
<dt>
|
||||
<b>actual</b>
|
||||
|
||||
</dt>
|
||||
<dd></dd>
|
||||
|
||||
<dt>
|
||||
<b>results</b>
|
||||
|
||||
</dt>
|
||||
<dd></dd>
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<hr />
|
||||
|
||||
<a name=".MessageResult"> </a>
|
||||
<div class="fixedFont"><static>
|
||||
|
||||
|
||||
<span class="light">jasmine.</span><b>MessageResult</b>(text)
|
||||
|
||||
</div>
|
||||
<div class="description">
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="detailList">
|
||||
<dt class="heading">Parameters:</dt>
|
||||
|
||||
<dt>
|
||||
<b>text</b>
|
||||
|
||||
</dt>
|
||||
<dd></dd>
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<hr />
|
||||
|
||||
<a name=".pp"> </a>
|
||||
|
@ -996,90 +651,6 @@ Jasmine environment.
|
|||
<div class="description">
|
||||
Base class for pretty printing for expectation results.
|
||||
|
||||
<br />
|
||||
<i>Defined in: </i> <a href="../symbols/src/src_PrettyPrinter.js.html">PrettyPrinter.js</a>.
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<hr />
|
||||
|
||||
<a name=".specFilter"> </a>
|
||||
<div class="fixedFont"><static>
|
||||
|
||||
|
||||
<span class="light">jasmine.</span><b>specFilter</b>()
|
||||
|
||||
</div>
|
||||
<div class="description">
|
||||
|
||||
|
||||
<br />
|
||||
<i>Defined in: </i> <a href="../symbols/src/src_Env.js.html">Env.js</a>.
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<hr />
|
||||
|
||||
<a name=".StringPrettyPrinter"> </a>
|
||||
<div class="fixedFont"><static>
|
||||
|
||||
|
||||
<span class="light">jasmine.</span><b>StringPrettyPrinter</b>()
|
||||
|
||||
</div>
|
||||
<div class="description">
|
||||
|
||||
|
||||
<br />
|
||||
<i>Defined in: </i> <a href="../symbols/src/src_PrettyPrinter.js.html">PrettyPrinter.js</a>.
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<hr />
|
||||
|
||||
<a name=".XmlHttpRequest"> </a>
|
||||
<div class="fixedFont"><static>
|
||||
|
||||
|
||||
<span class="light">jasmine.</span><b>XmlHttpRequest</b>()
|
||||
|
||||
</div>
|
||||
<div class="description">
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
@ -1107,7 +678,7 @@ Jasmine environment.
|
|||
<!-- ============================== footer ================================= -->
|
||||
<div class="fineprint" style="clear:both">
|
||||
|
||||
Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.3.0 on Sun Jun 28 2009 13:34:05 GMT-0700 (PDT)
|
||||
Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.3.0 on Thu Jul 09 2009 21:42:18 GMT-0700 (PDT)
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -195,12 +195,20 @@ ul.inheritsList
|
|||
|
||||
<li><a href="../symbols/jasmine.ActionCollection.html">jasmine.ActionCollection</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Env.html">jasmine.Env</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.MultiReporter.html">jasmine.MultiReporter</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.NestedResults.html">jasmine.NestedResults</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.QueuedFunction.html">jasmine.QueuedFunction</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Reporter.html">jasmine.Reporter</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Runner.html">jasmine.Runner</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Spec.html">jasmine.Spec</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Spy.html">jasmine.Spy</a></li>
|
||||
|
||||
<li><a href="../symbols/jasmine.Suite.html">jasmine.Suite</a></li>
|
||||
|
@ -226,7 +234,7 @@ ul.inheritsList
|
|||
|
||||
|
||||
|
||||
<br /><i>Defined in: </i> <a href="../symbols/src/src_util.js.html">util.js</a>.
|
||||
<br /><i>Defined in: </i> <a href="../symbols/src/lib_jasmine.js.html">jasmine.js</a>.
|
||||
|
||||
</p>
|
||||
|
||||
|
@ -259,51 +267,6 @@ ul.inheritsList
|
|||
|
||||
<!-- ============================== methods summary ======================== -->
|
||||
|
||||
|
||||
|
||||
<table class="summaryTable" cellspacing="0" summary="A summary of the methods documented in the class jasmine.util.">
|
||||
<caption>Method Summary</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Method Attributes</th>
|
||||
<th scope="col">Method Name and Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<tr>
|
||||
<td class="attributes"><static> </td>
|
||||
<td class="nameDescription">
|
||||
<div class="fixedFont">jasmine.util.<b><a href="../symbols/jasmine.util.html#.argsToArray">argsToArray</a></b>(args)
|
||||
</div>
|
||||
<div class="description"></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="attributes"><static> </td>
|
||||
<td class="nameDescription">
|
||||
<div class="fixedFont">jasmine.util.<b><a href="../symbols/jasmine.util.html#.formatException">formatException</a></b>(e)
|
||||
</div>
|
||||
<div class="description"></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="attributes"><static> </td>
|
||||
<td class="nameDescription">
|
||||
<div class="fixedFont">jasmine.util.<b><a href="../symbols/jasmine.util.html#.htmlEscape">htmlEscape</a></b>(str)
|
||||
</div>
|
||||
<div class="description"></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- ============================== events summary ======================== -->
|
||||
|
||||
|
||||
|
@ -342,119 +305,6 @@ ul.inheritsList
|
|||
|
||||
<!-- ============================== method details ========================= -->
|
||||
|
||||
<div class="sectionTitle">
|
||||
Method Detail
|
||||
</div>
|
||||
|
||||
<a name=".argsToArray"> </a>
|
||||
<div class="fixedFont"><static>
|
||||
|
||||
|
||||
<span class="light">jasmine.util.</span><b>argsToArray</b>(args)
|
||||
|
||||
</div>
|
||||
<div class="description">
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="detailList">
|
||||
<dt class="heading">Parameters:</dt>
|
||||
|
||||
<dt>
|
||||
<b>args</b>
|
||||
|
||||
</dt>
|
||||
<dd></dd>
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<hr />
|
||||
|
||||
<a name=".formatException"> </a>
|
||||
<div class="fixedFont"><static>
|
||||
|
||||
|
||||
<span class="light">jasmine.util.</span><b>formatException</b>(e)
|
||||
|
||||
</div>
|
||||
<div class="description">
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="detailList">
|
||||
<dt class="heading">Parameters:</dt>
|
||||
|
||||
<dt>
|
||||
<b>e</b>
|
||||
|
||||
</dt>
|
||||
<dd></dd>
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<hr />
|
||||
|
||||
<a name=".htmlEscape"> </a>
|
||||
<div class="fixedFont"><static>
|
||||
|
||||
|
||||
<span class="light">jasmine.util.</span><b>htmlEscape</b>(str)
|
||||
|
||||
</div>
|
||||
<div class="description">
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<dl class="detailList">
|
||||
<dt class="heading">Parameters:</dt>
|
||||
|
||||
<dt>
|
||||
<b>str</b>
|
||||
|
||||
</dt>
|
||||
<dd></dd>
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- ============================== event details ========================= -->
|
||||
|
||||
|
@ -466,7 +316,7 @@ ul.inheritsList
|
|||
<!-- ============================== footer ================================= -->
|
||||
<div class="fineprint" style="clear:both">
|
||||
|
||||
Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.3.0 on Sun Jun 28 2009 13:34:06 GMT-0700 (PDT)
|
||||
Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.3.0 on Thu Jul 09 2009 21:42:19 GMT-0700 (PDT)
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,100 +0,0 @@
|
|||
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
|
||||
.KEYW {color: #933;}
|
||||
.COMM {color: #bbb; font-style: italic;}
|
||||
.NUMB {color: #393;}
|
||||
.STRN {color: #393;}
|
||||
.REGX {color: #339;}
|
||||
.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
|
||||
</style></head><body><pre><span class='line'> 1</span> <span class="COMM">/**
|
||||
<span class='line'> 2</span> * base for Runner & Suite: allows for a queue of functions to get executed, allowing for
|
||||
<span class='line'> 3</span> * any one action to complete, including asynchronous calls, before going to the next
|
||||
<span class='line'> 4</span> * action.
|
||||
<span class='line'> 5</span> *
|
||||
<span class='line'> 6</span> * @constructor
|
||||
<span class='line'> 7</span> * @param {jasmine.Env} env
|
||||
<span class='line'> 8</span> */</span><span class="WHIT">
|
||||
<span class='line'> 9</span> </span><span class="NAME">jasmine.ActionCollection</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">env</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 10</span> </span><span class="WHIT"> </span><span class="NAME">this.env</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">env</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 11</span> </span><span class="WHIT"> </span><span class="NAME">this.actions</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 12</span> </span><span class="WHIT"> </span><span class="NAME">this.index</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 13</span> </span><span class="WHIT"> </span><span class="NAME">this.finished</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 14</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 15</span>
|
||||
<span class='line'> 16</span> </span><span class="COMM">/**
|
||||
<span class='line'> 17</span> * Marks the collection as done & calls the finish callback, if there is one
|
||||
<span class='line'> 18</span> */</span><span class="WHIT">
|
||||
<span class='line'> 19</span> </span><span class="NAME">jasmine.ActionCollection.prototype.finish</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 20</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.finishCallback</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 21</span> </span><span class="WHIT"> </span><span class="NAME">this.finishCallback</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 22</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 23</span> </span><span class="WHIT"> </span><span class="NAME">this.finished</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 24</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 25</span>
|
||||
<span class='line'> 26</span> </span><span class="COMM">/**
|
||||
<span class='line'> 27</span> * Starts executing the queue of functions/actions.
|
||||
<span class='line'> 28</span> */</span><span class="WHIT">
|
||||
<span class='line'> 29</span> </span><span class="NAME">jasmine.ActionCollection.prototype.execute</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 30</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.actions.length</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 31</span> </span><span class="WHIT"> </span><span class="NAME">this.next</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 32</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 33</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 34</span>
|
||||
<span class='line'> 35</span> </span><span class="COMM">/**
|
||||
<span class='line'> 36</span> * Gets the current action.
|
||||
<span class='line'> 37</span> */</span><span class="WHIT">
|
||||
<span class='line'> 38</span> </span><span class="NAME">jasmine.ActionCollection.prototype.getCurrentAction</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 39</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.actions</span><span class="PUNC">[</span><span class="NAME">this.index</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 40</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 41</span>
|
||||
<span class='line'> 42</span> </span><span class="COMM">/**
|
||||
<span class='line'> 43</span> * Executes the next queued function/action. If there are no more in the queue, calls #finish.
|
||||
<span class='line'> 44</span> */</span><span class="WHIT">
|
||||
<span class='line'> 45</span> </span><span class="NAME">jasmine.ActionCollection.prototype.next</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 46</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.index</span><span class="WHIT"> </span><span class="PUNC">>=</span><span class="WHIT"> </span><span class="NAME">this.actions.length</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 47</span> </span><span class="WHIT"> </span><span class="NAME">this.finish</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 48</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 49</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 50</span>
|
||||
<span class='line'> 51</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">currentAction</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.getCurrentAction</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 52</span>
|
||||
<span class='line'> 53</span> </span><span class="WHIT"> </span><span class="NAME">currentAction.execute</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 54</span>
|
||||
<span class='line'> 55</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">currentAction.afterCallbacks</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 56</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC"><</span><span class="WHIT"> </span><span class="NAME">currentAction.afterCallbacks.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 57</span> </span><span class="WHIT"> </span><span class="KEYW">try</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 58</span> </span><span class="WHIT"> </span><span class="NAME">currentAction.afterCallbacks</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 59</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">catch</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 60</span> </span><span class="WHIT"> </span><span class="NAME">alert</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 61</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 62</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 63</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 64</span>
|
||||
<span class='line'> 65</span> </span><span class="WHIT"> </span><span class="NAME">this.waitForDone</span><span class="PUNC">(</span><span class="NAME">currentAction</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 66</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 67</span>
|
||||
<span class='line'> 68</span> </span><span class="NAME">jasmine.ActionCollection.prototype.waitForDone</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">action</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 69</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">self</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 70</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">afterExecute</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">afterExecute</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 71</span> </span><span class="WHIT"> </span><span class="NAME">self.index</span><span class="PUNC">++</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 72</span> </span><span class="WHIT"> </span><span class="NAME">self.next</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 73</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 74</span>
|
||||
<span class='line'> 75</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">action.finished</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 76</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">now</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Date</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">getTime</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 77</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.env.updateInterval</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">now</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">this.env.lastUpdate</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NAME">this.env.updateInterval</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 78</span> </span><span class="WHIT"> </span><span class="NAME">this.env.lastUpdate</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">now</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 79</span> </span><span class="WHIT"> </span><span class="NAME">this.env.setTimeout</span><span class="PUNC">(</span><span class="NAME">afterExecute</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 80</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 81</span> </span><span class="WHIT"> </span><span class="NAME">afterExecute</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 82</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 83</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 84</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 85</span>
|
||||
<span class='line'> 86</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">id</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.env.setInterval</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 87</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">action.finished</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 88</span> </span><span class="WHIT"> </span><span class="NAME">self.env.clearInterval</span><span class="PUNC">(</span><span class="NAME">id</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 89</span> </span><span class="WHIT"> </span><span class="NAME">afterExecute</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 90</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 91</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">150</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 92</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 93</span> </span></pre></body></html>
|
|
@ -1,179 +0,0 @@
|
|||
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
|
||||
.KEYW {color: #933;}
|
||||
.COMM {color: #bbb; font-style: italic;}
|
||||
.NUMB {color: #393;}
|
||||
.STRN {color: #393;}
|
||||
.REGX {color: #339;}
|
||||
.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
|
||||
</style></head><body><pre><span class='line'> 1</span> <span class="NAME">jasmine.Env</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 2</span> </span><span class="WHIT"> </span><span class="NAME">this.currentSpec</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 3</span> </span><span class="WHIT"> </span><span class="NAME">this.currentSuite</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 4</span> </span><span class="WHIT"> </span><span class="NAME">this.currentRunner</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">jasmine.Runner</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 5</span> </span><span class="WHIT"> </span><span class="NAME">this.currentlyRunningTests</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 6</span>
|
||||
<span class='line'> 7</span> </span><span class="WHIT"> </span><span class="NAME">this.updateInterval</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 8</span> </span><span class="WHIT"> </span><span class="NAME">this.lastUpdate</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 9</span> </span><span class="WHIT"> </span><span class="NAME">this.specFilter</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 10</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 11</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 12</span>
|
||||
<span class='line'> 13</span> </span><span class="WHIT"> </span><span class="NAME">this.nextSpecId_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 14</span> </span><span class="WHIT"> </span><span class="NAME">this.equalityTesters_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 15</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 16</span>
|
||||
<span class='line'> 17</span>
|
||||
<span class='line'> 18</span> </span><span class="NAME">jasmine.Env.prototype.setTimeout</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">jasmine.setTimeout</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 19</span> </span><span class="NAME">jasmine.Env.prototype.clearTimeout</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">jasmine.clearTimeout</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 20</span> </span><span class="NAME">jasmine.Env.prototype.setInterval</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">jasmine.setInterval</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 21</span> </span><span class="NAME">jasmine.Env.prototype.clearInterval</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">jasmine.clearInterval</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 22</span>
|
||||
<span class='line'> 23</span> </span><span class="NAME">jasmine.Env.prototype.execute</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 24</span> </span><span class="WHIT"> </span><span class="NAME">this.currentRunner.execute</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 25</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 26</span>
|
||||
<span class='line'> 27</span> </span><span class="NAME">jasmine.Env.prototype.describe</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">description</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">specDefinitions</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 28</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">suite</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">jasmine.Suite</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">description</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">specDefinitions</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.currentSuite</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 29</span>
|
||||
<span class='line'> 30</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">parentSuite</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.currentSuite</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 31</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">parentSuite</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 32</span> </span><span class="WHIT"> </span><span class="NAME">parentSuite.specs.push</span><span class="PUNC">(</span><span class="NAME">suite</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 33</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 34</span> </span><span class="WHIT"> </span><span class="NAME">this.currentRunner.suites.push</span><span class="PUNC">(</span><span class="NAME">suite</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 35</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 36</span>
|
||||
<span class='line'> 37</span> </span><span class="WHIT"> </span><span class="NAME">this.currentSuite</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">suite</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 38</span>
|
||||
<span class='line'> 39</span> </span><span class="WHIT"> </span><span class="NAME">specDefinitions.call</span><span class="PUNC">(</span><span class="NAME">suite</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 40</span>
|
||||
<span class='line'> 41</span> </span><span class="WHIT"> </span><span class="NAME">this.currentSuite</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">parentSuite</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 42</span>
|
||||
<span class='line'> 43</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">suite</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 44</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 45</span>
|
||||
<span class='line'> 46</span> </span><span class="NAME">jasmine.Env.prototype.beforeEach</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">beforeEachFunction</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 47</span> </span><span class="WHIT"> </span><span class="NAME">this.currentSuite.beforeEach</span><span class="PUNC">(</span><span class="NAME">beforeEachFunction</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 48</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 49</span>
|
||||
<span class='line'> 50</span> </span><span class="NAME">jasmine.Env.prototype.afterEach</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">afterEachFunction</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 51</span> </span><span class="WHIT"> </span><span class="NAME">this.currentSuite.afterEach</span><span class="PUNC">(</span><span class="NAME">afterEachFunction</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 52</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 53</span>
|
||||
<span class='line'> 54</span> </span><span class="NAME">jasmine.Env.prototype.xdescribe</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">desc</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">specDefinitions</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 55</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 56</span> </span><span class="WHIT"> </span><span class="NAME">execute</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 57</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 58</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 59</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 60</span>
|
||||
<span class='line'> 61</span> </span><span class="NAME">jasmine.Env.prototype.it</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">description</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">func</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 62</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">spec</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">jasmine.Spec</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.currentSuite</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">description</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 63</span> </span><span class="WHIT"> </span><span class="NAME">this.currentSuite.specs.push</span><span class="PUNC">(</span><span class="NAME">spec</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 64</span> </span><span class="WHIT"> </span><span class="NAME">this.currentSpec</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">spec</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 65</span>
|
||||
<span class='line'> 66</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">func</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 67</span> </span><span class="WHIT"> </span><span class="NAME">spec.addToQueue</span><span class="PUNC">(</span><span class="NAME">func</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 68</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 69</span>
|
||||
<span class='line'> 70</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">spec</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 71</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 72</span>
|
||||
<span class='line'> 73</span> </span><span class="NAME">jasmine.Env.prototype.xit</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">desc</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">func</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 74</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 75</span> </span><span class="WHIT"> </span><span class="NAME">id</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.nextSpecId_</span><span class="PUNC">++</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'> 76</span> </span><span class="WHIT"> </span><span class="NAME">runs</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 77</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 78</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 79</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 80</span>
|
||||
<span class='line'> 81</span> </span><span class="NAME">jasmine.Env.prototype.compareObjects_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">a</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">b</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">mismatchKeys</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">mismatchValues</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 82</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">a.__Jasmine_been_here_before__</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">b</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">b.__Jasmine_been_here_before__</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">a</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 83</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 84</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 85</span>
|
||||
<span class='line'> 86</span> </span><span class="WHIT"> </span><span class="NAME">a.__Jasmine_been_here_before__</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">b</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 87</span> </span><span class="WHIT"> </span><span class="NAME">b.__Jasmine_been_here_before__</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">a</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 88</span>
|
||||
<span class='line'> 89</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">hasKey</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">obj</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">keyName</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 90</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">obj</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">obj</span><span class="PUNC">[</span><span class="NAME">keyName</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 91</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 92</span>
|
||||
<span class='line'> 93</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">property</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">b</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 94</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">hasKey</span><span class="PUNC">(</span><span class="NAME">a</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">property</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">hasKey</span><span class="PUNC">(</span><span class="NAME">b</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">property</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 95</span> </span><span class="WHIT"> </span><span class="NAME">mismatchKeys.push</span><span class="PUNC">(</span><span class="STRN">"expected has key '"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">property</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"', but missing from <b>actual</b>."</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 96</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 97</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 98</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">property</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">a</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 99</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">hasKey</span><span class="PUNC">(</span><span class="NAME">b</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">property</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">hasKey</span><span class="PUNC">(</span><span class="NAME">a</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">property</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>100</span> </span><span class="WHIT"> </span><span class="NAME">mismatchKeys.push</span><span class="PUNC">(</span><span class="STRN">"<b>expected</b> missing key '"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">property</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"', but present in actual."</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>101</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>102</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>103</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">property</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">b</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>104</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">property</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'__Jasmine_been_here_before__'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">continue</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>105</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">this.equals_</span><span class="PUNC">(</span><span class="NAME">a</span><span class="PUNC">[</span><span class="NAME">property</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">b</span><span class="PUNC">[</span><span class="NAME">property</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">mismatchKeys</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">mismatchValues</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>106</span> </span><span class="WHIT"> </span><span class="NAME">mismatchValues.push</span><span class="PUNC">(</span><span class="STRN">"'"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">property</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"' was<br /><br />'"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">b</span><span class="PUNC">[</span><span class="NAME">property</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">jasmine.util.htmlEscape</span><span class="PUNC">(</span><span class="NAME">b</span><span class="PUNC">[</span><span class="NAME">property</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">toString</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">b</span><span class="PUNC">[</span><span class="NAME">property</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"'<br /><br />in expected, but was<br /><br />'"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">a</span><span class="PUNC">[</span><span class="NAME">property</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">jasmine.util.htmlEscape</span><span class="PUNC">(</span><span class="NAME">a</span><span class="PUNC">[</span><span class="NAME">property</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">toString</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">a</span><span class="PUNC">[</span><span class="NAME">property</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"'<br /><br />in actual.<br />"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>107</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>108</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>109</span>
|
||||
<span class='line'>110</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">jasmine.isArray_</span><span class="PUNC">(</span><span class="NAME">a</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">jasmine.isArray_</span><span class="PUNC">(</span><span class="NAME">b</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">a.length</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="NAME">b.length</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>111</span> </span><span class="WHIT"> </span><span class="NAME">mismatchValues.push</span><span class="PUNC">(</span><span class="STRN">"arrays were not the same length"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>112</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>113</span>
|
||||
<span class='line'>114</span> </span><span class="WHIT"> </span><span class="KEYW">delete</span><span class="WHIT"> </span><span class="NAME">a.__Jasmine_been_here_before__</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>115</span> </span><span class="WHIT"> </span><span class="KEYW">delete</span><span class="WHIT"> </span><span class="NAME">b.__Jasmine_been_here_before__</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>116</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">mismatchKeys.length</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">mismatchValues.length</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>117</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>118</span>
|
||||
<span class='line'>119</span> </span><span class="NAME">jasmine.Env.prototype.equals_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">a</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">b</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">mismatchKeys</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">mismatchValues</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>120</span> </span><span class="WHIT"> </span><span class="NAME">mismatchKeys</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">mismatchKeys</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>121</span> </span><span class="WHIT"> </span><span class="NAME">mismatchValues</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">mismatchValues</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>122</span>
|
||||
<span class='line'>123</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">a</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">b</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>124</span>
|
||||
<span class='line'>125</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">a</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">a</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">b</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">b</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>126</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">a</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">b</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>127</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>128</span>
|
||||
<span class='line'>129</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">jasmine.isDomNode</span><span class="PUNC">(</span><span class="NAME">a</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">jasmine.isDomNode</span><span class="PUNC">(</span><span class="NAME">b</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>130</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">a</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">b</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>131</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>132</span>
|
||||
<span class='line'>133</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">a</span><span class="WHIT"> </span><span class="KEYW">instanceof</span><span class="WHIT"> </span><span class="NAME">Date</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">b</span><span class="WHIT"> </span><span class="KEYW">instanceof</span><span class="WHIT"> </span><span class="NAME">Date</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>134</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">a.getTime</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">b.getTime</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>135</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>136</span>
|
||||
<span class='line'>137</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">a</span><span class="WHIT"> </span><span class="KEYW">instanceof</span><span class="WHIT"> </span><span class="NAME">jasmine.Matchers.Any</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>138</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">a.matches</span><span class="PUNC">(</span><span class="NAME">b</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>139</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>140</span>
|
||||
<span class='line'>141</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">b</span><span class="WHIT"> </span><span class="KEYW">instanceof</span><span class="WHIT"> </span><span class="NAME">jasmine.Matchers.Any</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>142</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">b.matches</span><span class="PUNC">(</span><span class="NAME">a</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>143</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>144</span>
|
||||
<span class='line'>145</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">a</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">"object"</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">b</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">"object"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>146</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.compareObjects_</span><span class="PUNC">(</span><span class="NAME">a</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">b</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">mismatchKeys</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">mismatchValues</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>147</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>148</span>
|
||||
<span class='line'>149</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC"><</span><span class="WHIT"> </span><span class="NAME">this.equalityTesters_.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>150</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">equalityTester</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.equalityTesters_</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>151</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">result</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">equalityTester</span><span class="PUNC">(</span><span class="NAME">a</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">b</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">mismatchKeys</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">mismatchValues</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>152</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">result</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">result</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>153</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>154</span>
|
||||
<span class='line'>155</span> </span><span class="WHIT"> </span><span class="COMM">//Straight check</span><span class="WHIT">
|
||||
<span class='line'>156</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">a</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">b</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>157</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>158</span>
|
||||
<span class='line'>159</span> </span><span class="NAME">jasmine.Env.prototype.contains_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">haystack</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">needle</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>160</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">jasmine.isArray_</span><span class="PUNC">(</span><span class="NAME">haystack</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>161</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC"><</span><span class="WHIT"> </span><span class="NAME">haystack.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>162</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.equals_</span><span class="PUNC">(</span><span class="NAME">haystack</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">needle</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>163</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>164</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>165</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>166</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">haystack.indexOf</span><span class="PUNC">(</span><span class="NAME">needle</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">>=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>167</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>168</span>
|
||||
<span class='line'>169</span> </span><span class="NAME">jasmine.Env.prototype.addEqualityTester</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">equalityTester</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>170</span> </span><span class="WHIT"> </span><span class="NAME">this.equalityTesters_.push</span><span class="PUNC">(</span><span class="NAME">equalityTester</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>171</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>172</span> </span></pre></body></html>
|
|
@ -1,280 +0,0 @@
|
|||
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
|
||||
.KEYW {color: #933;}
|
||||
.COMM {color: #bbb; font-style: italic;}
|
||||
.NUMB {color: #393;}
|
||||
.STRN {color: #393;}
|
||||
.REGX {color: #339;}
|
||||
.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
|
||||
</style></head><body><pre><span class='line'> 1</span> <span class="NAME">jasmine.Matchers</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">env</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">actual</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">results</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 2</span> </span><span class="WHIT"> </span><span class="NAME">this.env</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">env</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 3</span> </span><span class="WHIT"> </span><span class="NAME">this.actual</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">actual</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 4</span> </span><span class="WHIT"> </span><span class="NAME">this.passing_message</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'Passed.'</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 5</span> </span><span class="WHIT"> </span><span class="NAME">this.results</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">results</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">jasmine.NestedResults</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 6</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 7</span>
|
||||
<span class='line'> 8</span> </span><span class="NAME">jasmine.Matchers.pp</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">str</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 9</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">jasmine.util.htmlEscape</span><span class="PUNC">(</span><span class="NAME">jasmine.pp</span><span class="PUNC">(</span><span class="NAME">str</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 10</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 11</span>
|
||||
<span class='line'> 12</span> </span><span class="NAME">jasmine.Matchers.prototype.getResults</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 13</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.results</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 14</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 15</span>
|
||||
<span class='line'> 16</span> </span><span class="NAME">jasmine.Matchers.prototype.report</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">result</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">failing_message</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">details</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 17</span> </span><span class="WHIT"> </span><span class="NAME">this.results.addResult</span><span class="PUNC">(</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">jasmine.ExpectationResult</span><span class="PUNC">(</span><span class="NAME">result</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">result</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">this.passing_message</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">failing_message</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">details</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 18</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">result</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 19</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 20</span>
|
||||
<span class='line'> 21</span> </span><span class="COMM">/**
|
||||
<span class='line'> 22</span> * Matcher that compares the actual to the expected using ===.
|
||||
<span class='line'> 23</span> *
|
||||
<span class='line'> 24</span> * @param expected
|
||||
<span class='line'> 25</span> */</span><span class="WHIT">
|
||||
<span class='line'> 26</span> </span><span class="NAME">jasmine.Matchers.prototype.toBe</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">expected</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 27</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.report</span><span class="PUNC">(</span><span class="NAME">this.actual</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">expected</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'Expected<br /><br />'</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">jasmine.Matchers.pp</span><span class="PUNC">(</span><span class="NAME">expected</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'> 28</span> </span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'<br /><br />to be the same object as<br /><br />'</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">jasmine.Matchers.pp</span><span class="PUNC">(</span><span class="NAME">this.actual</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'> 29</span> </span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'<br />'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 30</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 31</span>
|
||||
<span class='line'> 32</span> </span><span class="COMM">/**
|
||||
<span class='line'> 33</span> * Matcher that compares the actual to the expected using !==
|
||||
<span class='line'> 34</span> * @param expected
|
||||
<span class='line'> 35</span> */</span><span class="WHIT">
|
||||
<span class='line'> 36</span> </span><span class="NAME">jasmine.Matchers.prototype.toNotBe</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">expected</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 37</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.report</span><span class="PUNC">(</span><span class="NAME">this.actual</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="NAME">expected</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'Expected<br /><br />'</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">jasmine.Matchers.pp</span><span class="PUNC">(</span><span class="NAME">expected</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'> 38</span> </span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'<br /><br />to be a different object from actual, but they were the same.'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 39</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 40</span>
|
||||
<span class='line'> 41</span> </span><span class="COMM">/**
|
||||
<span class='line'> 42</span> * Matcher that compares the actual to the expected using common sense equality. Handles Objects, Arrays, etc.
|
||||
<span class='line'> 43</span> *
|
||||
<span class='line'> 44</span> * @param expected
|
||||
<span class='line'> 45</span> */</span><span class="WHIT">
|
||||
<span class='line'> 46</span> </span><span class="NAME">jasmine.Matchers.prototype.toEqual</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">expected</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 47</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">mismatchKeys</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 48</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">mismatchValues</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 49</span>
|
||||
<span class='line'> 50</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">formatMismatches</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">name</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">array</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 51</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">array.length</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 52</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">errorOutput</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'<br /><br />Different '</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">name</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">':<br />'</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 53</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC"><</span><span class="WHIT"> </span><span class="NAME">array.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 54</span> </span><span class="WHIT"> </span><span class="NAME">errorOutput</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">array</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'<br />'</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 55</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 56</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">errorOutput</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 57</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 58</span>
|
||||
<span class='line'> 59</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.report</span><span class="PUNC">(</span><span class="NAME">this.env.equals_</span><span class="PUNC">(</span><span class="NAME">this.actual</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">expected</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">mismatchKeys</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">mismatchValues</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'> 60</span> </span><span class="WHIT"> </span><span class="STRN">'Expected<br /><br />'</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">jasmine.Matchers.pp</span><span class="PUNC">(</span><span class="NAME">expected</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'> 61</span> </span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'<br /><br />but got<br /><br />'</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">jasmine.Matchers.pp</span><span class="PUNC">(</span><span class="NAME">this.actual</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'> 62</span> </span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'<br />'</span><span class="WHIT">
|
||||
<span class='line'> 63</span> </span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">formatMismatches</span><span class="PUNC">(</span><span class="STRN">'Keys'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">mismatchKeys</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'> 64</span> </span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">formatMismatches</span><span class="PUNC">(</span><span class="STRN">'Values'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">mismatchValues</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 65</span> </span><span class="WHIT"> </span><span class="NAME">matcherName</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'toEqual'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">expected</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">expected</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">actual</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.actual</span><span class="WHIT">
|
||||
<span class='line'> 66</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 67</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 68</span> </span><span class="COMM">/** @deprecated */</span><span class="WHIT">
|
||||
<span class='line'> 69</span> </span><span class="NAME">jasmine.Matchers.prototype.should_equal</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">jasmine.Matchers.prototype.toEqual</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 70</span>
|
||||
<span class='line'> 71</span> </span><span class="COMM">/**
|
||||
<span class='line'> 72</span> * Matcher that compares the actual to the expected using the ! of jasmine.Matchers.toEqual
|
||||
<span class='line'> 73</span> * @param expected
|
||||
<span class='line'> 74</span> */</span><span class="WHIT">
|
||||
<span class='line'> 75</span> </span><span class="NAME">jasmine.Matchers.prototype.toNotEqual</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">expected</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 76</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.report</span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">this.env.equals_</span><span class="PUNC">(</span><span class="NAME">this.actual</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">expected</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'> 77</span> </span><span class="WHIT"> </span><span class="STRN">'Expected '</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">jasmine.Matchers.pp</span><span class="PUNC">(</span><span class="NAME">expected</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">' to not equal '</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">jasmine.Matchers.pp</span><span class="PUNC">(</span><span class="NAME">this.actual</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">', but it does.'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 78</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 79</span> </span><span class="COMM">/** @deprecated */</span><span class="WHIT">
|
||||
<span class='line'> 80</span> </span><span class="NAME">jasmine.Matchers.prototype.should_not_equal</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">jasmine.Matchers.prototype.toNotEqual</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 81</span>
|
||||
<span class='line'> 82</span> </span><span class="COMM">/**
|
||||
<span class='line'> 83</span> * Matcher that compares the actual to the expected using a regular expression. Constructs a RegExp, so takes
|
||||
<span class='line'> 84</span> * a pattern or a String.
|
||||
<span class='line'> 85</span> *
|
||||
<span class='line'> 86</span> * @param reg_exp
|
||||
<span class='line'> 87</span> */</span><span class="WHIT">
|
||||
<span class='line'> 88</span> </span><span class="NAME">jasmine.Matchers.prototype.toMatch</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">reg_exp</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 89</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.report</span><span class="PUNC">(</span><span class="PUNC">(</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">RegExp</span><span class="PUNC">(</span><span class="NAME">reg_exp</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">test</span><span class="PUNC">(</span><span class="NAME">this.actual</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'> 90</span> </span><span class="WHIT"> </span><span class="STRN">'Expected '</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">jasmine.Matchers.pp</span><span class="PUNC">(</span><span class="NAME">this.actual</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">' to match '</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">reg_exp</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'.'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 91</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 92</span> </span><span class="COMM">/** @deprecated */</span><span class="WHIT">
|
||||
<span class='line'> 93</span> </span><span class="NAME">jasmine.Matchers.prototype.should_match</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">jasmine.Matchers.prototype.toMatch</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 94</span>
|
||||
<span class='line'> 95</span> </span><span class="COMM">/**
|
||||
<span class='line'> 96</span> * Matcher that compares the actual to the expected using the boolean inverse of jasmine.Matchers.toMatch
|
||||
<span class='line'> 97</span> * @param reg_exp
|
||||
<span class='line'> 98</span> */</span><span class="WHIT">
|
||||
<span class='line'> 99</span> </span><span class="NAME">jasmine.Matchers.prototype.toNotMatch</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">reg_exp</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>100</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.report</span><span class="PUNC">(</span><span class="PUNC">(</span><span class="PUNC">!</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">RegExp</span><span class="PUNC">(</span><span class="NAME">reg_exp</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">test</span><span class="PUNC">(</span><span class="NAME">this.actual</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'>101</span> </span><span class="WHIT"> </span><span class="STRN">'Expected '</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">jasmine.Matchers.pp</span><span class="PUNC">(</span><span class="NAME">this.actual</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">' to not match '</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">reg_exp</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'.'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>102</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>103</span> </span><span class="COMM">/** @deprecated */</span><span class="WHIT">
|
||||
<span class='line'>104</span> </span><span class="NAME">jasmine.Matchers.prototype.should_not_match</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">jasmine.Matchers.prototype.toNotMatch</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>105</span>
|
||||
<span class='line'>106</span> </span><span class="COMM">/**
|
||||
<span class='line'>107</span> * Matcher that compares the acutal to undefined.
|
||||
<span class='line'>108</span> */</span><span class="WHIT">
|
||||
<span class='line'>109</span> </span><span class="NAME">jasmine.Matchers.prototype.toBeDefined</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>110</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.report</span><span class="PUNC">(</span><span class="PUNC">(</span><span class="NAME">this.actual</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'>111</span> </span><span class="WHIT"> </span><span class="STRN">'Expected a value to be defined but it was undefined.'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>112</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>113</span> </span><span class="COMM">/** @deprecated */</span><span class="WHIT">
|
||||
<span class='line'>114</span> </span><span class="NAME">jasmine.Matchers.prototype.should_be_defined</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">jasmine.Matchers.prototype.toBeDefined</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>115</span>
|
||||
<span class='line'>116</span> </span><span class="COMM">/**
|
||||
<span class='line'>117</span> * Matcher that compares the actual to null.
|
||||
<span class='line'>118</span> *
|
||||
<span class='line'>119</span> */</span><span class="WHIT">
|
||||
<span class='line'>120</span> </span><span class="NAME">jasmine.Matchers.prototype.toBeNull</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>121</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.report</span><span class="PUNC">(</span><span class="PUNC">(</span><span class="NAME">this.actual</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'>122</span> </span><span class="WHIT"> </span><span class="STRN">'Expected a value to be null but it was '</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">jasmine.Matchers.pp</span><span class="PUNC">(</span><span class="NAME">this.actual</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'.'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>123</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>124</span> </span><span class="COMM">/** @deprecated */</span><span class="WHIT">
|
||||
<span class='line'>125</span> </span><span class="NAME">jasmine.Matchers.prototype.should_be_null</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">jasmine.Matchers.prototype.toBeNull</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>126</span>
|
||||
<span class='line'>127</span> </span><span class="COMM">/**
|
||||
<span class='line'>128</span> * Matcher that boolean not-nots the actual.
|
||||
<span class='line'>129</span> */</span><span class="WHIT">
|
||||
<span class='line'>130</span> </span><span class="NAME">jasmine.Matchers.prototype.toBeTruthy</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>131</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.report</span><span class="PUNC">(</span><span class="PUNC">!</span><span class="PUNC">!</span><span class="NAME">this.actual</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'>132</span> </span><span class="WHIT"> </span><span class="STRN">'Expected a value to be truthy but it was '</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">jasmine.Matchers.pp</span><span class="PUNC">(</span><span class="NAME">this.actual</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'.'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>133</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>134</span> </span><span class="COMM">/** @deprecated */</span><span class="WHIT">
|
||||
<span class='line'>135</span> </span><span class="NAME">jasmine.Matchers.prototype.should_be_truthy</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">jasmine.Matchers.prototype.toBeTruthy</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>136</span>
|
||||
<span class='line'>137</span> </span><span class="COMM">/**
|
||||
<span class='line'>138</span> * Matcher that boolean nots the actual.
|
||||
<span class='line'>139</span> */</span><span class="WHIT">
|
||||
<span class='line'>140</span> </span><span class="NAME">jasmine.Matchers.prototype.toBeFalsy</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>141</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.report</span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">this.actual</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'>142</span> </span><span class="WHIT"> </span><span class="STRN">'Expected a value to be falsy but it was '</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">jasmine.Matchers.pp</span><span class="PUNC">(</span><span class="NAME">this.actual</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'.'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>143</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>144</span> </span><span class="COMM">/** @deprecated */</span><span class="WHIT">
|
||||
<span class='line'>145</span> </span><span class="NAME">jasmine.Matchers.prototype.should_be_falsy</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">jasmine.Matchers.prototype.toBeFalsy</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>146</span>
|
||||
<span class='line'>147</span> </span><span class="COMM">/**
|
||||
<span class='line'>148</span> * Matcher that checks to see if the acutal, a Jasmine spy, was called.
|
||||
<span class='line'>149</span> */</span><span class="WHIT">
|
||||
<span class='line'>150</span> </span><span class="NAME">jasmine.Matchers.prototype.wasCalled</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>151</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">this.actual</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">this.actual.isSpy</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>152</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.report</span><span class="PUNC">(</span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'Expected a spy, but got '</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">jasmine.Matchers.pp</span><span class="PUNC">(</span><span class="NAME">this.actual</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'.'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>153</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>154</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">arguments.length</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>155</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.report</span><span class="PUNC">(</span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'wasCalled matcher does not take arguments'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>156</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>157</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.report</span><span class="PUNC">(</span><span class="PUNC">(</span><span class="NAME">this.actual.wasCalled</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'>158</span> </span><span class="WHIT"> </span><span class="STRN">'Expected spy "'</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">this.actual.identity</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'" to have been called, but it was not.'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>159</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>160</span> </span><span class="COMM">/** @deprecated */</span><span class="WHIT">
|
||||
<span class='line'>161</span> </span><span class="NAME">jasmine.Matchers.prototype.was_called</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">jasmine.Matchers.prototype.wasCalled</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>162</span>
|
||||
<span class='line'>163</span> </span><span class="COMM">/**
|
||||
<span class='line'>164</span> * Matcher that checks to see if the acutal, a Jasmine spy, was not called.
|
||||
<span class='line'>165</span> */</span><span class="WHIT">
|
||||
<span class='line'>166</span> </span><span class="NAME">jasmine.Matchers.prototype.wasNotCalled</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>167</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">this.actual</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">this.actual.isSpy</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>168</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.report</span><span class="PUNC">(</span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'Expected a spy, but got '</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">jasmine.Matchers.pp</span><span class="PUNC">(</span><span class="NAME">this.actual</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'.'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>169</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>170</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.report</span><span class="PUNC">(</span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">this.actual.wasCalled</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'>171</span> </span><span class="WHIT"> </span><span class="STRN">'Expected spy "'</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">this.actual.identity</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'" to not have been called, but it was.'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>172</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>173</span> </span><span class="COMM">/** @deprecated */</span><span class="WHIT">
|
||||
<span class='line'>174</span> </span><span class="NAME">jasmine.Matchers.prototype.was_not_called</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">jasmine.Matchers.prototype.wasNotCalled</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>175</span>
|
||||
<span class='line'>176</span> </span><span class="COMM">/**
|
||||
<span class='line'>177</span> * Matcher that checks to see if the acutal, a Jasmine spy, was called with a set of parameters.
|
||||
<span class='line'>178</span> *
|
||||
<span class='line'>179</span> * @example
|
||||
<span class='line'>180</span> *
|
||||
<span class='line'>181</span> */</span><span class="WHIT">
|
||||
<span class='line'>182</span> </span><span class="NAME">jasmine.Matchers.prototype.wasCalledWith</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>183</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">this.actual</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">this.actual.isSpy</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>184</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.report</span><span class="PUNC">(</span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'Expected a spy, but got '</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">jasmine.Matchers.pp</span><span class="PUNC">(</span><span class="NAME">this.actual</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'.'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>185</span> </span><span class="WHIT"> </span><span class="NAME">matcherName</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'wasCalledWith'</span><span class="WHIT">
|
||||
<span class='line'>186</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>187</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>188</span>
|
||||
<span class='line'>189</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">args</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">jasmine.util.argsToArray</span><span class="PUNC">(</span><span class="NAME">arguments</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>190</span>
|
||||
<span class='line'>191</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.report</span><span class="PUNC">(</span><span class="NAME">this.env.contains_</span><span class="PUNC">(</span><span class="NAME">this.actual.argsForCall</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">args</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'>192</span> </span><span class="WHIT"> </span><span class="STRN">'Expected '</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">jasmine.Matchers.pp</span><span class="PUNC">(</span><span class="NAME">this.actual.argsForCall</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">' to contain '</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">jasmine.Matchers.pp</span><span class="PUNC">(</span><span class="NAME">args</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">', but it does not.'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>193</span> </span><span class="WHIT"> </span><span class="NAME">matcherName</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'wasCalledWith'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">expected</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">args</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">actual</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.actual.argsForCall</span><span class="WHIT">
|
||||
<span class='line'>194</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>195</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>196</span>
|
||||
<span class='line'>197</span> </span><span class="COMM">/**
|
||||
<span class='line'>198</span> * Matcher that checks that the expected item is an element in the actual Array.
|
||||
<span class='line'>199</span> *
|
||||
<span class='line'>200</span> * @param {Object} item
|
||||
<span class='line'>201</span> */</span><span class="WHIT">
|
||||
<span class='line'>202</span> </span><span class="NAME">jasmine.Matchers.prototype.toContain</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">item</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>203</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.report</span><span class="PUNC">(</span><span class="NAME">this.env.contains_</span><span class="PUNC">(</span><span class="NAME">this.actual</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">item</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'>204</span> </span><span class="WHIT"> </span><span class="STRN">'Expected '</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">jasmine.Matchers.pp</span><span class="PUNC">(</span><span class="NAME">this.actual</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">' to contain '</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">jasmine.Matchers.pp</span><span class="PUNC">(</span><span class="NAME">item</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">', but it does not.'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>205</span> </span><span class="WHIT"> </span><span class="NAME">matcherName</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'toContain'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">expected</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">item</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">actual</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.actual</span><span class="WHIT">
|
||||
<span class='line'>206</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>207</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>208</span>
|
||||
<span class='line'>209</span> </span><span class="COMM">/**
|
||||
<span class='line'>210</span> * Matcher that checks that the expected item is NOT an element in the actual Array.
|
||||
<span class='line'>211</span> *
|
||||
<span class='line'>212</span> * @param {Object} item
|
||||
<span class='line'>213</span> */</span><span class="WHIT">
|
||||
<span class='line'>214</span> </span><span class="NAME">jasmine.Matchers.prototype.toNotContain</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">item</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>215</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.report</span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">this.env.contains_</span><span class="PUNC">(</span><span class="NAME">this.actual</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">item</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'>216</span> </span><span class="WHIT"> </span><span class="STRN">'Expected '</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">jasmine.Matchers.pp</span><span class="PUNC">(</span><span class="NAME">this.actual</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">' not to contain '</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">jasmine.Matchers.pp</span><span class="PUNC">(</span><span class="NAME">item</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">', but it does.'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>217</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>218</span>
|
||||
<span class='line'>219</span> </span><span class="COMM">/**
|
||||
<span class='line'>220</span> * Matcher that checks that the expected exception was thrown by the actual.
|
||||
<span class='line'>221</span> *
|
||||
<span class='line'>222</span> * @param {String} expectedException
|
||||
<span class='line'>223</span> */</span><span class="WHIT">
|
||||
<span class='line'>224</span> </span><span class="NAME">jasmine.Matchers.prototype.toThrow</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">expectedException</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>225</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">exception</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>226</span> </span><span class="WHIT"> </span><span class="KEYW">try</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>227</span> </span><span class="WHIT"> </span><span class="NAME">this.actual</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>228</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">catch</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>229</span> </span><span class="WHIT"> </span><span class="NAME">exception</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">e</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>230</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>231</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">expectedException</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>232</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">exception</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>233</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.report</span><span class="PUNC">(</span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"Expected function to throw "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">jasmine.Matchers.pp</span><span class="PUNC">(</span><span class="NAME">expectedException</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">", but it did not."</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>234</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>235</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.report</span><span class="PUNC">(</span><span class="WHIT">
|
||||
<span class='line'>236</span> </span><span class="WHIT"> </span><span class="NAME">this.env.equals_</span><span class="PUNC">(</span><span class="WHIT">
|
||||
<span class='line'>237</span> </span><span class="WHIT"> </span><span class="NAME">exception.message</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">exception</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'>238</span> </span><span class="WHIT"> </span><span class="NAME">expectedException.message</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">expectedException</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'>239</span> </span><span class="WHIT"> </span><span class="STRN">"Expected function to throw "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">jasmine.Matchers.pp</span><span class="PUNC">(</span><span class="NAME">expectedException</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">", but it threw "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">jasmine.Matchers.pp</span><span class="PUNC">(</span><span class="NAME">exception</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"."</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>240</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>241</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.report</span><span class="PUNC">(</span><span class="NAME">exception</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"Expected function to throw an exception, but it did not."</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>242</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>243</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>244</span>
|
||||
<span class='line'>245</span> </span><span class="NAME">jasmine.Matchers.Any</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">expectedClass</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>246</span> </span><span class="WHIT"> </span><span class="NAME">this.expectedClass</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">expectedClass</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>247</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>248</span>
|
||||
<span class='line'>249</span> </span><span class="NAME">jasmine.Matchers.Any.prototype.matches</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">other</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>250</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.expectedClass</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">String</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>251</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">other</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'string'</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">other</span><span class="WHIT"> </span><span class="KEYW">instanceof</span><span class="WHIT"> </span><span class="NAME">String</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>252</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>253</span>
|
||||
<span class='line'>254</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.expectedClass</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">Number</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>255</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">other</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'number'</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">other</span><span class="WHIT"> </span><span class="KEYW">instanceof</span><span class="WHIT"> </span><span class="NAME">Number</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>256</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>257</span>
|
||||
<span class='line'>258</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.expectedClass</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">Function</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>259</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">other</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'function'</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">other</span><span class="WHIT"> </span><span class="KEYW">instanceof</span><span class="WHIT"> </span><span class="NAME">Function</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>260</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>261</span>
|
||||
<span class='line'>262</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.expectedClass</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">Object</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>263</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">other</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'object'</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>264</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>265</span>
|
||||
<span class='line'>266</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">other</span><span class="WHIT"> </span><span class="KEYW">instanceof</span><span class="WHIT"> </span><span class="NAME">this.expectedClass</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>267</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>268</span>
|
||||
<span class='line'>269</span> </span><span class="NAME">jasmine.Matchers.Any.prototype.toString</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>270</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="STRN">'<jasmine.any('</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">this.expectedClass</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">')>'</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>271</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>272</span>
|
||||
<span class='line'>273</span> </span></pre></body></html>
|
|
@ -1,88 +0,0 @@
|
|||
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
|
||||
.KEYW {color: #933;}
|
||||
.COMM {color: #bbb; font-style: italic;}
|
||||
.NUMB {color: #393;}
|
||||
.STRN {color: #393;}
|
||||
.REGX {color: #339;}
|
||||
.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
|
||||
</style></head><body><pre><span class='line'> 1</span> <span class="COMM">/**
|
||||
<span class='line'> 2</span> * Holds results for a set of Jasmine spec. Allows for the results array to hold another jasmine.NestedResults
|
||||
<span class='line'> 3</span> *
|
||||
<span class='line'> 4</span> * @constructor
|
||||
<span class='line'> 5</span> */</span><span class="WHIT">
|
||||
<span class='line'> 6</span> </span><span class="NAME">jasmine.NestedResults</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 7</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||
<span class='line'> 8</span> * The total count of results
|
||||
<span class='line'> 9</span> */</span><span class="WHIT">
|
||||
<span class='line'> 10</span> </span><span class="WHIT"> </span><span class="NAME">this.totalCount</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 11</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||
<span class='line'> 12</span> * Number of passed results
|
||||
<span class='line'> 13</span> */</span><span class="WHIT">
|
||||
<span class='line'> 14</span> </span><span class="WHIT"> </span><span class="NAME">this.passedCount</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 15</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||
<span class='line'> 16</span> * Number of failed results
|
||||
<span class='line'> 17</span> */</span><span class="WHIT">
|
||||
<span class='line'> 18</span> </span><span class="WHIT"> </span><span class="NAME">this.failedCount</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 19</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||
<span class='line'> 20</span> * Was this suite/spec skipped?
|
||||
<span class='line'> 21</span> */</span><span class="WHIT">
|
||||
<span class='line'> 22</span> </span><span class="WHIT"> </span><span class="NAME">this.skipped</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 23</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||
<span class='line'> 24</span> * @ignore
|
||||
<span class='line'> 25</span> */</span><span class="WHIT">
|
||||
<span class='line'> 26</span> </span><span class="WHIT"> </span><span class="NAME">this.items_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 27</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 28</span>
|
||||
<span class='line'> 29</span> </span><span class="COMM">/**
|
||||
<span class='line'> 30</span> * Roll up the result counts.
|
||||
<span class='line'> 31</span> *
|
||||
<span class='line'> 32</span> * @param result
|
||||
<span class='line'> 33</span> */</span><span class="WHIT">
|
||||
<span class='line'> 34</span> </span><span class="NAME">jasmine.NestedResults.prototype.rollupCounts</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">result</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 35</span> </span><span class="WHIT"> </span><span class="NAME">this.totalCount</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">result.totalCount</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 36</span> </span><span class="WHIT"> </span><span class="NAME">this.passedCount</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">result.passedCount</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 37</span> </span><span class="WHIT"> </span><span class="NAME">this.failedCount</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">result.failedCount</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 38</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 39</span>
|
||||
<span class='line'> 40</span> </span><span class="COMM">/**
|
||||
<span class='line'> 41</span> * Tracks a result's message.
|
||||
<span class='line'> 42</span> * @param message
|
||||
<span class='line'> 43</span> */</span><span class="WHIT">
|
||||
<span class='line'> 44</span> </span><span class="NAME">jasmine.NestedResults.prototype.log</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">message</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 45</span> </span><span class="WHIT"> </span><span class="NAME">this.items_.push</span><span class="PUNC">(</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">jasmine.MessageResult</span><span class="PUNC">(</span><span class="NAME">message</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 46</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 47</span>
|
||||
<span class='line'> 48</span> </span><span class="COMM">/**
|
||||
<span class='line'> 49</span> * Getter for the results: message & results.
|
||||
<span class='line'> 50</span> */</span><span class="WHIT">
|
||||
<span class='line'> 51</span> </span><span class="NAME">jasmine.NestedResults.prototype.getItems</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 52</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.items_</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 53</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 54</span>
|
||||
<span class='line'> 55</span> </span><span class="COMM">/**
|
||||
<span class='line'> 56</span> * Adds a result, tracking counts (total, passed, & failed)
|
||||
<span class='line'> 57</span> * @param {jasmine.ExpectationResult|jasmine.NestedResults} result
|
||||
<span class='line'> 58</span> */</span><span class="WHIT">
|
||||
<span class='line'> 59</span> </span><span class="NAME">jasmine.NestedResults.prototype.addResult</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">result</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 60</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">result.type</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">'MessageResult'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 61</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">result.items_</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 62</span> </span><span class="WHIT"> </span><span class="NAME">this.rollupCounts</span><span class="PUNC">(</span><span class="NAME">result</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 63</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 64</span> </span><span class="WHIT"> </span><span class="NAME">this.totalCount</span><span class="PUNC">++</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 65</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">result.passed</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 66</span> </span><span class="WHIT"> </span><span class="NAME">this.passedCount</span><span class="PUNC">++</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 67</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 68</span> </span><span class="WHIT"> </span><span class="NAME">this.failedCount</span><span class="PUNC">++</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 69</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 70</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 71</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 72</span> </span><span class="WHIT"> </span><span class="NAME">this.items_.push</span><span class="PUNC">(</span><span class="NAME">result</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 73</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 74</span>
|
||||
<span class='line'> 75</span> </span><span class="COMM">/**
|
||||
<span class='line'> 76</span> * @returns {Boolean} True if <b>everything</b> below passed
|
||||
<span class='line'> 77</span> */</span><span class="WHIT">
|
||||
<span class='line'> 78</span> </span><span class="NAME">jasmine.NestedResults.prototype.passed</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 79</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.passedCount</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">this.totalCount</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 80</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 81</span> </span></pre></body></html>
|
|
@ -1,123 +0,0 @@
|
|||
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
|
||||
.KEYW {color: #933;}
|
||||
.COMM {color: #bbb; font-style: italic;}
|
||||
.NUMB {color: #393;}
|
||||
.STRN {color: #393;}
|
||||
.REGX {color: #339;}
|
||||
.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
|
||||
</style></head><body><pre><span class='line'> 1</span> <span class="COMM">/**
|
||||
<span class='line'> 2</span> * Base class for pretty printing for expectation results.
|
||||
<span class='line'> 3</span> */</span><span class="WHIT">
|
||||
<span class='line'> 4</span> </span><span class="NAME">jasmine.PrettyPrinter</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 5</span> </span><span class="WHIT"> </span><span class="NAME">this.ppNestLevel_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 6</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 7</span>
|
||||
<span class='line'> 8</span> </span><span class="COMM">/**
|
||||
<span class='line'> 9</span> * Formats a value in a nice, human-readable string.
|
||||
<span class='line'> 10</span> *
|
||||
<span class='line'> 11</span> * @param value
|
||||
<span class='line'> 12</span> * @returns {String}
|
||||
<span class='line'> 13</span> */</span><span class="WHIT">
|
||||
<span class='line'> 14</span> </span><span class="NAME">jasmine.PrettyPrinter.prototype.format</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">value</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 15</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.ppNestLevel_</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NUMB">40</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 16</span> </span><span class="WHIT"> </span><span class="COMM">// return '(jasmine.pp nested too deeply!)';</span><span class="WHIT">
|
||||
<span class='line'> 17</span> </span><span class="WHIT"> </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Error</span><span class="PUNC">(</span><span class="STRN">'jasmine.PrettyPrinter: format() nested too deeply!'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 18</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 19</span>
|
||||
<span class='line'> 20</span> </span><span class="WHIT"> </span><span class="NAME">this.ppNestLevel_</span><span class="PUNC">++</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 21</span> </span><span class="WHIT"> </span><span class="KEYW">try</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 22</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 23</span> </span><span class="WHIT"> </span><span class="NAME">this.emitScalar</span><span class="PUNC">(</span><span class="STRN">'undefined'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 24</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 25</span> </span><span class="WHIT"> </span><span class="NAME">this.emitScalar</span><span class="PUNC">(</span><span class="STRN">'null'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 26</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">value.navigator</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">value.frames</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">value.setTimeout</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 27</span> </span><span class="WHIT"> </span><span class="NAME">this.emitScalar</span><span class="PUNC">(</span><span class="STRN">'<window>'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 28</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">value</span><span class="WHIT"> </span><span class="KEYW">instanceof</span><span class="WHIT"> </span><span class="NAME">jasmine.Matchers.Any</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 29</span> </span><span class="WHIT"> </span><span class="NAME">this.emitScalar</span><span class="PUNC">(</span><span class="NAME">value.toString</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 30</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">'string'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 31</span> </span><span class="WHIT"> </span><span class="NAME">this.emitScalar</span><span class="PUNC">(</span><span class="STRN">"'"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"'"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 32</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">'function'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 33</span> </span><span class="WHIT"> </span><span class="NAME">this.emitScalar</span><span class="PUNC">(</span><span class="STRN">'Function'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 34</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">value.nodeType</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">'number'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 35</span> </span><span class="WHIT"> </span><span class="NAME">this.emitScalar</span><span class="PUNC">(</span><span class="STRN">'HTMLNode'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 36</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">value</span><span class="WHIT"> </span><span class="KEYW">instanceof</span><span class="WHIT"> </span><span class="NAME">Date</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 37</span> </span><span class="WHIT"> </span><span class="NAME">this.emitScalar</span><span class="PUNC">(</span><span class="STRN">'Date('</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">')'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 38</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">value.__Jasmine_been_here_before__</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 39</span> </span><span class="WHIT"> </span><span class="NAME">this.emitScalar</span><span class="PUNC">(</span><span class="STRN">'<circular reference: '</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">jasmine.isArray_</span><span class="PUNC">(</span><span class="NAME">value</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="STRN">'Array'</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'Object'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'>'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 40</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">jasmine.isArray_</span><span class="PUNC">(</span><span class="NAME">value</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'object'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 41</span> </span><span class="WHIT"> </span><span class="NAME">value.__Jasmine_been_here_before__</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 42</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">jasmine.isArray_</span><span class="PUNC">(</span><span class="NAME">value</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 43</span> </span><span class="WHIT"> </span><span class="NAME">this.emitArray</span><span class="PUNC">(</span><span class="NAME">value</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 44</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 45</span> </span><span class="WHIT"> </span><span class="NAME">this.emitObject</span><span class="PUNC">(</span><span class="NAME">value</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 46</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 47</span> </span><span class="WHIT"> </span><span class="KEYW">delete</span><span class="WHIT"> </span><span class="NAME">value.__Jasmine_been_here_before__</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 48</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 49</span> </span><span class="WHIT"> </span><span class="NAME">this.emitScalar</span><span class="PUNC">(</span><span class="NAME">value.toString</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 50</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 51</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">finally</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 52</span> </span><span class="WHIT"> </span><span class="NAME">this.ppNestLevel_</span><span class="PUNC">--</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 53</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 54</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 55</span>
|
||||
<span class='line'> 56</span> </span><span class="NAME">jasmine.PrettyPrinter.prototype.iterateObject</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">obj</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">fn</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 57</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">property</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">obj</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 58</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">property</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'__Jasmine_been_here_before__'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">continue</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 59</span> </span><span class="WHIT"> </span><span class="NAME">fn</span><span class="PUNC">(</span><span class="NAME">property</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">obj.__lookupGetter__</span><span class="PUNC">(</span><span class="NAME">property</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 60</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 61</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 62</span>
|
||||
<span class='line'> 63</span> </span><span class="NAME">jasmine.PrettyPrinter.prototype.emitArray</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">jasmine.unimplementedMethod_</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 64</span> </span><span class="NAME">jasmine.PrettyPrinter.prototype.emitObject</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">jasmine.unimplementedMethod_</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 65</span> </span><span class="NAME">jasmine.PrettyPrinter.prototype.emitScalar</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">jasmine.unimplementedMethod_</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 66</span>
|
||||
<span class='line'> 67</span> </span><span class="NAME">jasmine.StringPrettyPrinter</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 68</span> </span><span class="WHIT"> </span><span class="NAME">jasmine.PrettyPrinter.call</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 69</span>
|
||||
<span class='line'> 70</span> </span><span class="WHIT"> </span><span class="NAME">this.string</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 71</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 72</span> </span><span class="NAME">jasmine.util.inherit</span><span class="PUNC">(</span><span class="NAME">jasmine.StringPrettyPrinter</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">jasmine.PrettyPrinter</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 73</span>
|
||||
<span class='line'> 74</span> </span><span class="NAME">jasmine.StringPrettyPrinter.prototype.emitScalar</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">value</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 75</span> </span><span class="WHIT"> </span><span class="NAME">this.append</span><span class="PUNC">(</span><span class="NAME">value</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 76</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 77</span>
|
||||
<span class='line'> 78</span> </span><span class="NAME">jasmine.StringPrettyPrinter.prototype.emitArray</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">array</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 79</span> </span><span class="WHIT"> </span><span class="NAME">this.append</span><span class="PUNC">(</span><span class="STRN">'[ '</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 80</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC"><</span><span class="WHIT"> </span><span class="NAME">array.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 81</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 82</span> </span><span class="WHIT"> </span><span class="NAME">this.append</span><span class="PUNC">(</span><span class="STRN">', '</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 83</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 84</span> </span><span class="WHIT"> </span><span class="NAME">this.format</span><span class="PUNC">(</span><span class="NAME">array</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 85</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 86</span> </span><span class="WHIT"> </span><span class="NAME">this.append</span><span class="PUNC">(</span><span class="STRN">' ]'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 87</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 88</span>
|
||||
<span class='line'> 89</span> </span><span class="NAME">jasmine.StringPrettyPrinter.prototype.emitObject</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">obj</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 90</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">self</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 91</span> </span><span class="WHIT"> </span><span class="NAME">this.append</span><span class="PUNC">(</span><span class="STRN">'{ '</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 92</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">first</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 93</span>
|
||||
<span class='line'> 94</span> </span><span class="WHIT"> </span><span class="NAME">this.iterateObject</span><span class="PUNC">(</span><span class="NAME">obj</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">property</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">isGetter</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 95</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">first</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 96</span> </span><span class="WHIT"> </span><span class="NAME">first</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 97</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 98</span> </span><span class="WHIT"> </span><span class="NAME">self.append</span><span class="PUNC">(</span><span class="STRN">', '</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 99</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>100</span>
|
||||
<span class='line'>101</span> </span><span class="WHIT"> </span><span class="NAME">self.append</span><span class="PUNC">(</span><span class="NAME">property</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>102</span> </span><span class="WHIT"> </span><span class="NAME">self.append</span><span class="PUNC">(</span><span class="STRN">' : '</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>103</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">isGetter</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>104</span> </span><span class="WHIT"> </span><span class="NAME">self.append</span><span class="PUNC">(</span><span class="STRN">'<getter>'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>105</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>106</span> </span><span class="WHIT"> </span><span class="NAME">self.format</span><span class="PUNC">(</span><span class="NAME">obj</span><span class="PUNC">[</span><span class="NAME">property</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>107</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>108</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>109</span>
|
||||
<span class='line'>110</span> </span><span class="WHIT"> </span><span class="NAME">this.append</span><span class="PUNC">(</span><span class="STRN">' }'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>111</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>112</span>
|
||||
<span class='line'>113</span> </span><span class="NAME">jasmine.StringPrettyPrinter.prototype.append</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">value</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>114</span> </span><span class="WHIT"> </span><span class="NAME">this.string</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>115</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>116</span> </span></pre></body></html>
|
|
@ -1,94 +0,0 @@
|
|||
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
|
||||
.KEYW {color: #933;}
|
||||
.COMM {color: #bbb; font-style: italic;}
|
||||
.NUMB {color: #393;}
|
||||
.STRN {color: #393;}
|
||||
.REGX {color: #339;}
|
||||
.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
|
||||
</style></head><body><pre><span class='line'> 1</span> <span class="COMM">/**
|
||||
<span class='line'> 2</span> * QueuedFunction is how ActionCollections' actions are implemented
|
||||
<span class='line'> 3</span> *
|
||||
<span class='line'> 4</span> * @constructor
|
||||
<span class='line'> 5</span> * @param {jasmine.Env} env
|
||||
<span class='line'> 6</span> * @param {Function} func
|
||||
<span class='line'> 7</span> * @param {Number} timeout
|
||||
<span class='line'> 8</span> * @param {Function} latchFunction
|
||||
<span class='line'> 9</span> * @param {jasmine.Spec} spec
|
||||
<span class='line'> 10</span> */</span><span class="WHIT">
|
||||
<span class='line'> 11</span> </span><span class="NAME">jasmine.QueuedFunction</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">env</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">func</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">timeout</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">latchFunction</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">spec</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 12</span> </span><span class="WHIT"> </span><span class="NAME">this.env</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">env</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 13</span> </span><span class="WHIT"> </span><span class="NAME">this.func</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">func</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 14</span> </span><span class="WHIT"> </span><span class="NAME">this.timeout</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">timeout</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 15</span> </span><span class="WHIT"> </span><span class="NAME">this.latchFunction</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">latchFunction</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 16</span> </span><span class="WHIT"> </span><span class="NAME">this.spec</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">spec</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 17</span>
|
||||
<span class='line'> 18</span> </span><span class="WHIT"> </span><span class="NAME">this.totalTimeSpentWaitingForLatch</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 19</span> </span><span class="WHIT"> </span><span class="NAME">this.latchTimeoutIncrement</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">100</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 20</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 21</span>
|
||||
<span class='line'> 22</span> </span><span class="NAME">jasmine.QueuedFunction.prototype.next</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 23</span> </span><span class="WHIT"> </span><span class="NAME">this.spec.finish</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">// default value is to be done after one function</span><span class="WHIT">
|
||||
<span class='line'> 24</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 25</span>
|
||||
<span class='line'> 26</span> </span><span class="NAME">jasmine.QueuedFunction.prototype.safeExecute</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 27</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.env.reporter</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 28</span> </span><span class="WHIT"> </span><span class="NAME">this.env.reporter.log</span><span class="PUNC">(</span><span class="STRN">'>> Jasmine Running '</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">this.spec.suite.description</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">' '</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">this.spec.description</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'...'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 29</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 30</span>
|
||||
<span class='line'> 31</span> </span><span class="WHIT"> </span><span class="KEYW">try</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 32</span> </span><span class="WHIT"> </span><span class="NAME">this.func.apply</span><span class="PUNC">(</span><span class="NAME">this.spec</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 33</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">catch</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 34</span> </span><span class="WHIT"> </span><span class="NAME">this.fail</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 35</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 36</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 37</span>
|
||||
<span class='line'> 38</span> </span><span class="NAME">jasmine.QueuedFunction.prototype.execute</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 39</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">self</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 40</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">executeNow</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 41</span> </span><span class="WHIT"> </span><span class="NAME">self.safeExecute</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 42</span> </span><span class="WHIT"> </span><span class="NAME">self.next</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 43</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 44</span>
|
||||
<span class='line'> 45</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">executeLater</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 46</span> </span><span class="WHIT"> </span><span class="NAME">self.env.setTimeout</span><span class="PUNC">(</span><span class="NAME">executeNow</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">self.timeout</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 47</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 48</span>
|
||||
<span class='line'> 49</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">executeNowOrLater</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 50</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">latchFunctionResult</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 51</span>
|
||||
<span class='line'> 52</span> </span><span class="WHIT"> </span><span class="KEYW">try</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 53</span> </span><span class="WHIT"> </span><span class="NAME">latchFunctionResult</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self.latchFunction.apply</span><span class="PUNC">(</span><span class="NAME">self.spec</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 54</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">catch</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 55</span> </span><span class="WHIT"> </span><span class="NAME">self.fail</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 56</span> </span><span class="WHIT"> </span><span class="NAME">self.next</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 57</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 58</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 59</span>
|
||||
<span class='line'> 60</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">latchFunctionResult</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 61</span> </span><span class="WHIT"> </span><span class="NAME">executeNow</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 62</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">self.totalTimeSpentWaitingForLatch</span><span class="WHIT"> </span><span class="PUNC">>=</span><span class="WHIT"> </span><span class="NAME">self.timeout</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 63</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">message</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'timed out after '</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">self.timeout</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">' msec waiting for '</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">self.latchFunction.description</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="STRN">'something to happen'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 64</span> </span><span class="WHIT"> </span><span class="NAME">self.fail</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 65</span> </span><span class="WHIT"> </span><span class="NAME">name</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'timeout'</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'> 66</span> </span><span class="WHIT"> </span><span class="NAME">message</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">message</span><span class="WHIT">
|
||||
<span class='line'> 67</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 68</span> </span><span class="WHIT"> </span><span class="NAME">self.next</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 69</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 70</span> </span><span class="WHIT"> </span><span class="NAME">self.totalTimeSpentWaitingForLatch</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self.latchTimeoutIncrement</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 71</span> </span><span class="WHIT"> </span><span class="NAME">self.env.setTimeout</span><span class="PUNC">(</span><span class="NAME">executeNowOrLater</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">self.latchTimeoutIncrement</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 72</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 73</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 74</span>
|
||||
<span class='line'> 75</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.latchFunction</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 76</span> </span><span class="WHIT"> </span><span class="NAME">executeNowOrLater</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 77</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.timeout</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 78</span> </span><span class="WHIT"> </span><span class="NAME">executeLater</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 79</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 80</span> </span><span class="WHIT"> </span><span class="NAME">executeNow</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 81</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 82</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 83</span>
|
||||
<span class='line'> 84</span> </span><span class="NAME">jasmine.QueuedFunction.prototype.fail</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 85</span> </span><span class="WHIT"> </span><span class="NAME">this.spec.results.addResult</span><span class="PUNC">(</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">jasmine.ExpectationResult</span><span class="PUNC">(</span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">jasmine.util.formatException</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 86</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 87</span> </span></pre></body></html>
|
|
@ -1,41 +0,0 @@
|
|||
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
|
||||
.KEYW {color: #933;}
|
||||
.COMM {color: #bbb; font-style: italic;}
|
||||
.NUMB {color: #393;}
|
||||
.STRN {color: #393;}
|
||||
.REGX {color: #339;}
|
||||
.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
|
||||
</style></head><body><pre><span class='line'> 1</span> <span class="COMM">/* JasmineReporters.reporter
|
||||
<span class='line'> 2</span> * Base object that will get called whenever a Spec, Suite, or Runner is done. It is up to
|
||||
<span class='line'> 3</span> * descendants of this object to do something with the results (see json_reporter.js)
|
||||
<span class='line'> 4</span> */</span><span class="WHIT">
|
||||
<span class='line'> 5</span> </span><span class="NAME">jasmine.Reporters</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 6</span>
|
||||
<span class='line'> 7</span> </span><span class="NAME">jasmine.Reporters.reporter</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">callbacks</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 8</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">that</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 9</span> </span><span class="WHIT"> </span><span class="NAME">callbacks</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">callbacks</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'> 10</span>
|
||||
<span class='line'> 11</span> </span><span class="WHIT"> </span><span class="NAME">doCallback</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">callback</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">results</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 12</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">callback</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 13</span> </span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">(</span><span class="NAME">results</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 14</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 15</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'> 16</span>
|
||||
<span class='line'> 17</span> </span><span class="WHIT"> </span><span class="NAME">reportRunnerResults</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">runner</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 18</span> </span><span class="WHIT"> </span><span class="NAME">that.doCallback</span><span class="PUNC">(</span><span class="NAME">that.callbacks.runnerCallback</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">runner</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 19</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'> 20</span> </span><span class="WHIT"> </span><span class="NAME">reportSuiteResults</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">suite</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 21</span> </span><span class="WHIT"> </span><span class="NAME">that.doCallback</span><span class="PUNC">(</span><span class="NAME">that.callbacks.suiteCallback</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">suite</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 22</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'> 23</span> </span><span class="WHIT"> </span><span class="NAME">reportSpecResults</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">spec</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 24</span> </span><span class="WHIT"> </span><span class="NAME">that.doCallback</span><span class="PUNC">(</span><span class="NAME">that.callbacks.specCallback</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">spec</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 25</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'> 26</span> </span><span class="WHIT"> </span><span class="NAME">log</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">str</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 27</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">console</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">console.log</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">console.log</span><span class="PUNC">(</span><span class="NAME">str</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 28</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 29</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 30</span>
|
||||
<span class='line'> 31</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">that</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 32</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 33</span>
|
||||
<span class='line'> 34</span> </span></pre></body></html>
|
|
@ -1,34 +0,0 @@
|
|||
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
|
||||
.KEYW {color: #933;}
|
||||
.COMM {color: #bbb; font-style: italic;}
|
||||
.NUMB {color: #393;}
|
||||
.STRN {color: #393;}
|
||||
.REGX {color: #339;}
|
||||
.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
|
||||
</style></head><body><pre><span class='line'> 1</span> <span class="COMM">/**
|
||||
<span class='line'> 2</span> * Runner
|
||||
<span class='line'> 3</span> *
|
||||
<span class='line'> 4</span> * @constructor
|
||||
<span class='line'> 5</span> * @param {jasmine.Env} env
|
||||
<span class='line'> 6</span> */</span><span class="WHIT">
|
||||
<span class='line'> 7</span> </span><span class="NAME">jasmine.Runner</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">env</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 8</span> </span><span class="WHIT"> </span><span class="NAME">jasmine.ActionCollection.call</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">env</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 9</span>
|
||||
<span class='line'> 10</span> </span><span class="WHIT"> </span><span class="NAME">this.suites</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.actions</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 11</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 12</span> </span><span class="NAME">jasmine.util.inherit</span><span class="PUNC">(</span><span class="NAME">jasmine.Runner</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">jasmine.ActionCollection</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 13</span>
|
||||
<span class='line'> 14</span> </span><span class="NAME">jasmine.Runner.prototype.finishCallback</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 15</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.env.reporter</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 16</span> </span><span class="WHIT"> </span><span class="NAME">this.env.reporter.reportRunnerResults</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 17</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 18</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 19</span>
|
||||
<span class='line'> 20</span> </span><span class="NAME">jasmine.Runner.prototype.getResults</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 21</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">results</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">jasmine.NestedResults</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 22</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC"><</span><span class="WHIT"> </span><span class="NAME">this.suites.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 23</span> </span><span class="WHIT"> </span><span class="NAME">results.rollupCounts</span><span class="PUNC">(</span><span class="NAME">this.suites</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">getResults</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 24</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 25</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">results</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 26</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 27</span> </span></pre></body></html>
|
|
@ -1,199 +0,0 @@
|
|||
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
|
||||
.KEYW {color: #933;}
|
||||
.COMM {color: #bbb; font-style: italic;}
|
||||
.NUMB {color: #393;}
|
||||
.STRN {color: #393;}
|
||||
.REGX {color: #339;}
|
||||
.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
|
||||
</style></head><body><pre><span class='line'> 1</span> <span class="COMM">/**
|
||||
<span class='line'> 2</span> * Internal representation of a Jasmine specification, or test.
|
||||
<span class='line'> 3</span> * @private
|
||||
<span class='line'> 4</span> * @constructs
|
||||
<span class='line'> 5</span> * @param {jasmine.Env} env
|
||||
<span class='line'> 6</span> * @param {jasmine.Suite} suite
|
||||
<span class='line'> 7</span> * @param {String} description
|
||||
<span class='line'> 8</span> */</span><span class="WHIT">
|
||||
<span class='line'> 9</span> </span><span class="NAME">jasmine.Spec</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">env</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">suite</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">description</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 10</span> </span><span class="WHIT"> </span><span class="NAME">this.id</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">env.nextSpecId_</span><span class="PUNC">++</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 11</span> </span><span class="WHIT"> </span><span class="NAME">this.env</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">env</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 12</span> </span><span class="WHIT"> </span><span class="NAME">this.suite</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">suite</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 13</span> </span><span class="WHIT"> </span><span class="NAME">this.description</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">description</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 14</span> </span><span class="WHIT"> </span><span class="NAME">this.queue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 15</span> </span><span class="WHIT"> </span><span class="NAME">this.currentTimeout</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 16</span> </span><span class="WHIT"> </span><span class="NAME">this.currentLatchFunction</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 17</span> </span><span class="WHIT"> </span><span class="NAME">this.finished</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 18</span> </span><span class="WHIT"> </span><span class="NAME">this.afterCallbacks</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 19</span> </span><span class="WHIT"> </span><span class="NAME">this.spies_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 20</span>
|
||||
<span class='line'> 21</span> </span><span class="WHIT"> </span><span class="NAME">this.results</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">jasmine.NestedResults</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 22</span> </span><span class="WHIT"> </span><span class="NAME">this.results.description</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">description</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 23</span> </span><span class="WHIT"> </span><span class="NAME">this.runs</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.addToQueue</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 24</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 25</span>
|
||||
<span class='line'> 26</span> </span><span class="NAME">jasmine.Spec.prototype.getFullName</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 27</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.suite.getFullName</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">' '</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">this.description</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'.'</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 28</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 29</span>
|
||||
<span class='line'> 30</span> </span><span class="NAME">jasmine.Spec.prototype.getResults</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 31</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.results</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 32</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 33</span>
|
||||
<span class='line'> 34</span> </span><span class="NAME">jasmine.Spec.prototype.addToQueue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">func</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 35</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">queuedFunction</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">jasmine.QueuedFunction</span><span class="PUNC">(</span><span class="NAME">this.env</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">func</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.currentTimeout</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.currentLatchFunction</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 36</span> </span><span class="WHIT"> </span><span class="NAME">this.queue.push</span><span class="PUNC">(</span><span class="NAME">queuedFunction</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 37</span>
|
||||
<span class='line'> 38</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.queue.length</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 39</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">previousQueuedFunction</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.queue</span><span class="PUNC">[</span><span class="NAME">this.queue.length</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 40</span> </span><span class="WHIT"> </span><span class="NAME">previousQueuedFunction.next</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 41</span> </span><span class="WHIT"> </span><span class="NAME">queuedFunction.execute</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 42</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 43</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 44</span>
|
||||
<span class='line'> 45</span> </span><span class="WHIT"> </span><span class="NAME">this.resetTimeout</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 46</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 47</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 48</span>
|
||||
<span class='line'> 49</span> </span><span class="COMM">/**
|
||||
<span class='line'> 50</span> * @private
|
||||
<span class='line'> 51</span> * @deprecated
|
||||
<span class='line'> 52</span> */</span><span class="WHIT">
|
||||
<span class='line'> 53</span> </span><span class="NAME">jasmine.Spec.prototype.expects_that</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">actual</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 54</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.expect</span><span class="PUNC">(</span><span class="NAME">actual</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 55</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 56</span>
|
||||
<span class='line'> 57</span> </span><span class="COMM">/**
|
||||
<span class='line'> 58</span> * @private
|
||||
<span class='line'> 59</span> * @deprecated
|
||||
<span class='line'> 60</span> */</span><span class="WHIT">
|
||||
<span class='line'> 61</span> </span><span class="NAME">jasmine.Spec.prototype.expect</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">actual</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 62</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">jasmine.Matchers</span><span class="PUNC">(</span><span class="NAME">this.env</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">actual</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.results</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 63</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 64</span>
|
||||
<span class='line'> 65</span> </span><span class="COMM">/**
|
||||
<span class='line'> 66</span> * @private
|
||||
<span class='line'> 67</span> * @deprecated
|
||||
<span class='line'> 68</span> */</span><span class="WHIT">
|
||||
<span class='line'> 69</span> </span><span class="NAME">jasmine.Spec.prototype.waits</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">timeout</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 70</span> </span><span class="WHIT"> </span><span class="NAME">this.currentTimeout</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">timeout</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 71</span> </span><span class="WHIT"> </span><span class="NAME">this.currentLatchFunction</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 72</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 73</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 74</span>
|
||||
<span class='line'> 75</span> </span><span class="COMM">/**
|
||||
<span class='line'> 76</span> * @private
|
||||
<span class='line'> 77</span> * @deprecated
|
||||
<span class='line'> 78</span> */</span><span class="WHIT">
|
||||
<span class='line'> 79</span> </span><span class="NAME">jasmine.Spec.prototype.waitsFor</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">timeout</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">latchFunction</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">message</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 80</span> </span><span class="WHIT"> </span><span class="NAME">this.currentTimeout</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">timeout</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 81</span> </span><span class="WHIT"> </span><span class="NAME">this.currentLatchFunction</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">latchFunction</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 82</span> </span><span class="WHIT"> </span><span class="NAME">this.currentLatchFunction.description</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">message</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 83</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 84</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 85</span>
|
||||
<span class='line'> 86</span> </span><span class="NAME">jasmine.Spec.prototype.resetTimeout</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 87</span> </span><span class="WHIT"> </span><span class="NAME">this.currentTimeout</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 88</span> </span><span class="WHIT"> </span><span class="NAME">this.currentLatchFunction</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 89</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 90</span>
|
||||
<span class='line'> 91</span> </span><span class="NAME">jasmine.Spec.prototype.finishCallback</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 92</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.env.reporter</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 93</span> </span><span class="WHIT"> </span><span class="NAME">this.env.reporter.reportSpecResults</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 94</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 95</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 96</span>
|
||||
<span class='line'> 97</span> </span><span class="NAME">jasmine.Spec.prototype.finish</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 98</span> </span><span class="WHIT"> </span><span class="NAME">this.safeExecuteAfters</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 99</span>
|
||||
<span class='line'>100</span> </span><span class="WHIT"> </span><span class="NAME">this.removeAllSpies</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>101</span> </span><span class="WHIT"> </span><span class="NAME">this.finishCallback</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>102</span> </span><span class="WHIT"> </span><span class="NAME">this.finished</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>103</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>104</span>
|
||||
<span class='line'>105</span> </span><span class="NAME">jasmine.Spec.prototype.after</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">doAfter</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>106</span> </span><span class="WHIT"> </span><span class="NAME">this.afterCallbacks.unshift</span><span class="PUNC">(</span><span class="NAME">doAfter</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>107</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>108</span>
|
||||
<span class='line'>109</span> </span><span class="NAME">jasmine.Spec.prototype.execute</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>110</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">this.env.specFilter</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>111</span> </span><span class="WHIT"> </span><span class="NAME">this.results.skipped</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>112</span> </span><span class="WHIT"> </span><span class="NAME">this.finishCallback</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>113</span> </span><span class="WHIT"> </span><span class="NAME">this.finished</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>114</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>115</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>116</span>
|
||||
<span class='line'>117</span> </span><span class="WHIT"> </span><span class="NAME">this.env.currentSpec</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>118</span> </span><span class="WHIT"> </span><span class="NAME">this.env.currentlyRunningTests</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>119</span>
|
||||
<span class='line'>120</span> </span><span class="WHIT"> </span><span class="NAME">this.safeExecuteBefores</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>121</span>
|
||||
<span class='line'>122</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.queue</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>123</span> </span><span class="WHIT"> </span><span class="NAME">this.queue</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">execute</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>124</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>125</span> </span><span class="WHIT"> </span><span class="NAME">this.finish</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>126</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>127</span> </span><span class="WHIT"> </span><span class="NAME">this.env.currentlyRunningTests</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>128</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>129</span>
|
||||
<span class='line'>130</span> </span><span class="NAME">jasmine.Spec.prototype.safeExecuteBefores</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>131</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">befores</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>132</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">suite</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.suite</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">suite</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">suite</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">suite.parentSuite</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>133</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">suite.beforeEachFunction</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">befores.push</span><span class="PUNC">(</span><span class="NAME">suite.beforeEachFunction</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>134</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>135</span>
|
||||
<span class='line'>136</span> </span><span class="WHIT"> </span><span class="KEYW">while</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">befores.length</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>137</span> </span><span class="WHIT"> </span><span class="NAME">this.safeExecuteBeforeOrAfter</span><span class="PUNC">(</span><span class="NAME">befores.pop</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>138</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>139</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>140</span>
|
||||
<span class='line'>141</span> </span><span class="NAME">jasmine.Spec.prototype.safeExecuteAfters</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>142</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">suite</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.suite</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">suite</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">suite</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">suite.parentSuite</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>143</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">suite.afterEachFunction</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">this.safeExecuteBeforeOrAfter</span><span class="PUNC">(</span><span class="NAME">suite.afterEachFunction</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>144</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>145</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>146</span>
|
||||
<span class='line'>147</span> </span><span class="NAME">jasmine.Spec.prototype.safeExecuteBeforeOrAfter</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">func</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>148</span> </span><span class="WHIT"> </span><span class="KEYW">try</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>149</span> </span><span class="WHIT"> </span><span class="NAME">func.apply</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>150</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">catch</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>151</span> </span><span class="WHIT"> </span><span class="NAME">this.results.addResult</span><span class="PUNC">(</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">jasmine.ExpectationResult</span><span class="PUNC">(</span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">func.typeName</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'() fail: '</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">jasmine.util.formatException</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>152</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>153</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>154</span>
|
||||
<span class='line'>155</span> </span><span class="NAME">jasmine.Spec.prototype.explodes</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>156</span> </span><span class="WHIT"> </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="STRN">'explodes function should not have been called'</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>157</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>158</span>
|
||||
<span class='line'>159</span> </span><span class="NAME">jasmine.Spec.prototype.spyOn</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">obj</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">methodName</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">ignoreMethodDoesntExist</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>160</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">obj</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>161</span> </span><span class="WHIT"> </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="STRN">"spyOn could not find an object to spy upon for "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">methodName</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"()"</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>162</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>163</span>
|
||||
<span class='line'>164</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">ignoreMethodDoesntExist</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">obj</span><span class="PUNC">[</span><span class="NAME">methodName</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>165</span> </span><span class="WHIT"> </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="NAME">methodName</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'() method does not exist'</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>166</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>167</span>
|
||||
<span class='line'>168</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">ignoreMethodDoesntExist</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">obj</span><span class="PUNC">[</span><span class="NAME">methodName</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">obj</span><span class="PUNC">[</span><span class="NAME">methodName</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">isSpy</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>169</span> </span><span class="WHIT"> </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Error</span><span class="PUNC">(</span><span class="NAME">methodName</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">' has already been spied upon'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>170</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>171</span>
|
||||
<span class='line'>172</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">spyObj</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">jasmine.createSpy</span><span class="PUNC">(</span><span class="NAME">methodName</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>173</span>
|
||||
<span class='line'>174</span> </span><span class="WHIT"> </span><span class="NAME">this.spies_.push</span><span class="PUNC">(</span><span class="NAME">spyObj</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>175</span> </span><span class="WHIT"> </span><span class="NAME">spyObj.baseObj</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">obj</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>176</span> </span><span class="WHIT"> </span><span class="NAME">spyObj.methodName</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">methodName</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>177</span> </span><span class="WHIT"> </span><span class="NAME">spyObj.originalValue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">obj</span><span class="PUNC">[</span><span class="NAME">methodName</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>178</span>
|
||||
<span class='line'>179</span> </span><span class="WHIT"> </span><span class="NAME">obj</span><span class="PUNC">[</span><span class="NAME">methodName</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">spyObj</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>180</span>
|
||||
<span class='line'>181</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">spyObj</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>182</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>183</span>
|
||||
<span class='line'>184</span> </span><span class="NAME">jasmine.Spec.prototype.removeAllSpies</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>185</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC"><</span><span class="WHIT"> </span><span class="NAME">this.spies_.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>186</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">spy</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.spies_</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>187</span> </span><span class="WHIT"> </span><span class="NAME">spy.baseObj</span><span class="PUNC">[</span><span class="NAME">spy.methodName</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">spy.originalValue</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>188</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>189</span> </span><span class="WHIT"> </span><span class="NAME">this.spies_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>190</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>191</span>
|
||||
<span class='line'>192</span> </span></pre></body></html>
|
|
@ -1,61 +0,0 @@
|
|||
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
|
||||
.KEYW {color: #933;}
|
||||
.COMM {color: #bbb; font-style: italic;}
|
||||
.NUMB {color: #393;}
|
||||
.STRN {color: #393;}
|
||||
.REGX {color: #339;}
|
||||
.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
|
||||
</style></head><body><pre><span class='line'> 1</span> <span class="COMM">/**
|
||||
<span class='line'> 2</span> * For storing & executing a Jasmine suite.
|
||||
<span class='line'> 3</span> *
|
||||
<span class='line'> 4</span> * @constructor
|
||||
<span class='line'> 5</span> * @param {jasmine.Env} env
|
||||
<span class='line'> 6</span> * @param {String} description
|
||||
<span class='line'> 7</span> * @param {Function} specDefinitions
|
||||
<span class='line'> 8</span> * @param {jasmine.Suite} parentSuite
|
||||
<span class='line'> 9</span> */</span><span class="WHIT">
|
||||
<span class='line'> 10</span> </span><span class="NAME">jasmine.Suite</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">env</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">description</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">specDefinitions</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">parentSuite</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 11</span> </span><span class="WHIT"> </span><span class="NAME">jasmine.ActionCollection.call</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">env</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 12</span>
|
||||
<span class='line'> 13</span> </span><span class="WHIT"> </span><span class="NAME">this.description</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">description</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 14</span> </span><span class="WHIT"> </span><span class="NAME">this.specs</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.actions</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 15</span> </span><span class="WHIT"> </span><span class="NAME">this.parentSuite</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">parentSuite</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 16</span>
|
||||
<span class='line'> 17</span> </span><span class="WHIT"> </span><span class="NAME">this.beforeEachFunction</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 18</span> </span><span class="WHIT"> </span><span class="NAME">this.afterEachFunction</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 19</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 20</span> </span><span class="NAME">jasmine.util.inherit</span><span class="PUNC">(</span><span class="NAME">jasmine.Suite</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">jasmine.ActionCollection</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 21</span>
|
||||
<span class='line'> 22</span> </span><span class="NAME">jasmine.Suite.prototype.getFullName</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 23</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">fullName</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.description</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 24</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">parentSuite</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.parentSuite</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">parentSuite</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">parentSuite</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">parentSuite.parentSuite</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 25</span> </span><span class="WHIT"> </span><span class="NAME">fullName</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">parentSuite.description</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">' '</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">fullName</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 26</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 27</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">fullName</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 28</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 29</span>
|
||||
<span class='line'> 30</span> </span><span class="NAME">jasmine.Suite.prototype.finishCallback</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 31</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.env.reporter</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 32</span> </span><span class="WHIT"> </span><span class="NAME">this.env.reporter.reportSuiteResults</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 33</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 34</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 35</span>
|
||||
<span class='line'> 36</span> </span><span class="NAME">jasmine.Suite.prototype.beforeEach</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">beforeEachFunction</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 37</span> </span><span class="WHIT"> </span><span class="NAME">beforeEachFunction.typeName</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'beforeEach'</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 38</span> </span><span class="WHIT"> </span><span class="NAME">this.beforeEachFunction</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">beforeEachFunction</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 39</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 40</span>
|
||||
<span class='line'> 41</span> </span><span class="NAME">jasmine.Suite.prototype.afterEach</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">afterEachFunction</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 42</span> </span><span class="WHIT"> </span><span class="NAME">afterEachFunction.typeName</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'afterEach'</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 43</span> </span><span class="WHIT"> </span><span class="NAME">this.afterEachFunction</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">afterEachFunction</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 44</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 45</span>
|
||||
<span class='line'> 46</span> </span><span class="NAME">jasmine.Suite.prototype.getResults</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 47</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">results</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">jasmine.NestedResults</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 48</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC"><</span><span class="WHIT"> </span><span class="NAME">this.specs.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 49</span> </span><span class="WHIT"> </span><span class="NAME">results.rollupCounts</span><span class="PUNC">(</span><span class="NAME">this.specs</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">getResults</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 50</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 51</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">results</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 52</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 53</span>
|
||||
<span class='line'> 54</span> </span></pre></body></html>
|
|
@ -1,517 +0,0 @@
|
|||
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
|
||||
.KEYW {color: #933;}
|
||||
.COMM {color: #bbb; font-style: italic;}
|
||||
.NUMB {color: #393;}
|
||||
.STRN {color: #393;}
|
||||
.REGX {color: #339;}
|
||||
.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
|
||||
</style></head><body><pre><span class='line'> 1</span> <span class="COMM">/**
|
||||
<span class='line'> 2</span> * Top level namespace for Jasmine, a lightweight JavaScript BDD/spec/testing framework.
|
||||
<span class='line'> 3</span> *
|
||||
<span class='line'> 4</span> * @namespace
|
||||
<span class='line'> 5</span> */</span><span class="WHIT">
|
||||
<span class='line'> 6</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">jasmine</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 7</span>
|
||||
<span class='line'> 8</span> </span><span class="COMM">/**
|
||||
<span class='line'> 9</span> * @private
|
||||
<span class='line'> 10</span> */</span><span class="WHIT">
|
||||
<span class='line'> 11</span> </span><span class="NAME">jasmine.unimplementedMethod_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 12</span> </span><span class="WHIT"> </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Error</span><span class="PUNC">(</span><span class="STRN">"unimplemented method"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 13</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 14</span>
|
||||
<span class='line'> 15</span> </span><span class="COMM">/**
|
||||
<span class='line'> 16</span> * Allows for bound functions to be comapred. Internal use only.
|
||||
<span class='line'> 17</span> *
|
||||
<span class='line'> 18</span> * @ignore
|
||||
<span class='line'> 19</span> * @private
|
||||
<span class='line'> 20</span> * @param base {Object} bound 'this' for the function
|
||||
<span class='line'> 21</span> * @param name {Function} function to find
|
||||
<span class='line'> 22</span> */</span><span class="WHIT">
|
||||
<span class='line'> 23</span> </span><span class="NAME">jasmine.bindOriginal_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">base</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">name</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 24</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">original</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">base</span><span class="PUNC">[</span><span class="NAME">name</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 25</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 26</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">original.apply</span><span class="PUNC">(</span><span class="NAME">base</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">arguments</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 27</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 28</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 29</span>
|
||||
<span class='line'> 30</span> </span><span class="NAME">jasmine.setTimeout</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">jasmine.bindOriginal_</span><span class="PUNC">(</span><span class="NAME">window</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'setTimeout'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 31</span> </span><span class="NAME">jasmine.clearTimeout</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">jasmine.bindOriginal_</span><span class="PUNC">(</span><span class="NAME">window</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'clearTimeout'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 32</span> </span><span class="NAME">jasmine.setInterval</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">jasmine.bindOriginal_</span><span class="PUNC">(</span><span class="NAME">window</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'setInterval'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 33</span> </span><span class="NAME">jasmine.clearInterval</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">jasmine.bindOriginal_</span><span class="PUNC">(</span><span class="NAME">window</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'clearInterval'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 34</span>
|
||||
<span class='line'> 35</span> </span><span class="NAME">jasmine.MessageResult</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">text</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 36</span> </span><span class="WHIT"> </span><span class="NAME">this.type</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'MessageResult'</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 37</span> </span><span class="WHIT"> </span><span class="NAME">this.text</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">text</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 38</span> </span><span class="WHIT"> </span><span class="NAME">this.trace</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Error</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">// todo: test better</span><span class="WHIT">
|
||||
<span class='line'> 39</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 40</span>
|
||||
<span class='line'> 41</span> </span><span class="NAME">jasmine.ExpectationResult</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">passed</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">message</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">details</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 42</span> </span><span class="WHIT"> </span><span class="NAME">this.type</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'ExpectationResult'</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 43</span> </span><span class="WHIT"> </span><span class="NAME">this.passed</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">passed</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 44</span> </span><span class="WHIT"> </span><span class="NAME">this.message</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">message</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 45</span> </span><span class="WHIT"> </span><span class="NAME">this.details</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">details</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 46</span> </span><span class="WHIT"> </span><span class="NAME">this.trace</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Error</span><span class="PUNC">(</span><span class="NAME">message</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">// todo: test better</span><span class="WHIT">
|
||||
<span class='line'> 47</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 48</span>
|
||||
<span class='line'> 49</span> </span><span class="COMM">/**
|
||||
<span class='line'> 50</span> * Getter for the Jasmine environment. Ensures one gets created
|
||||
<span class='line'> 51</span> */</span><span class="WHIT">
|
||||
<span class='line'> 52</span> </span><span class="NAME">jasmine.getEnv</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 53</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">jasmine.currentEnv_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">jasmine.currentEnv_</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">jasmine.Env</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 54</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 55</span>
|
||||
<span class='line'> 56</span> </span><span class="COMM">/**
|
||||
<span class='line'> 57</span> * @ignore
|
||||
<span class='line'> 58</span> * @private
|
||||
<span class='line'> 59</span> * @param value
|
||||
<span class='line'> 60</span> * @returns {Boolean}
|
||||
<span class='line'> 61</span> */</span><span class="WHIT">
|
||||
<span class='line'> 62</span> </span><span class="NAME">jasmine.isArray_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">value</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 63</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT">
|
||||
<span class='line'> 64</span> </span><span class="WHIT"> </span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">'object'</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT">
|
||||
<span class='line'> 65</span> </span><span class="WHIT"> </span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">value.length</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">'number'</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT">
|
||||
<span class='line'> 66</span> </span><span class="WHIT"> </span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">value.splice</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">'function'</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT">
|
||||
<span class='line'> 67</span> </span><span class="WHIT"> </span><span class="PUNC">!</span><span class="PUNC">(</span><span class="NAME">value.propertyIsEnumerable</span><span class="PUNC">(</span><span class="STRN">'length'</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 68</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 69</span>
|
||||
<span class='line'> 70</span> </span><span class="COMM">/**
|
||||
<span class='line'> 71</span> * Pretty printer for expecations. Takes any object and turns it into a human-readable string.
|
||||
<span class='line'> 72</span> *
|
||||
<span class='line'> 73</span> * @param value {Object} an object to be outputted
|
||||
<span class='line'> 74</span> * @returns {String}
|
||||
<span class='line'> 75</span> */</span><span class="WHIT">
|
||||
<span class='line'> 76</span> </span><span class="NAME">jasmine.pp</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">value</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 77</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">stringPrettyPrinter</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">jasmine.StringPrettyPrinter</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 78</span> </span><span class="WHIT"> </span><span class="NAME">stringPrettyPrinter.format</span><span class="PUNC">(</span><span class="NAME">value</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 79</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">stringPrettyPrinter.string</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 80</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 81</span>
|
||||
<span class='line'> 82</span> </span><span class="COMM">/**
|
||||
<span class='line'> 83</span> * Returns true if the object is a DOM Node.
|
||||
<span class='line'> 84</span> *
|
||||
<span class='line'> 85</span> * @param {Object} obj object to check
|
||||
<span class='line'> 86</span> * @returns {Boolean}
|
||||
<span class='line'> 87</span> */</span><span class="WHIT">
|
||||
<span class='line'> 88</span> </span><span class="NAME">jasmine.isDomNode</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">obj</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 89</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">obj</span><span class="PUNC">[</span><span class="STRN">'nodeType'</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 90</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 91</span>
|
||||
<span class='line'> 92</span> </span><span class="COMM">/**
|
||||
<span class='line'> 93</span> * Returns a matchable 'generic' object of the class type. For use in expecations of type when values don't matter.
|
||||
<span class='line'> 94</span> *
|
||||
<span class='line'> 95</span> * @example
|
||||
<span class='line'> 96</span> * // don't care about which function is passed in, as long as it's a function
|
||||
<span class='line'> 97</span> * expect(mySpy).wasCalledWith(jasmine.any(Function));
|
||||
<span class='line'> 98</span> *
|
||||
<span class='line'> 99</span> * @param {Class} clazz
|
||||
<span class='line'>100</span> * @returns matchable object of the type clazz
|
||||
<span class='line'>101</span> */</span><span class="WHIT">
|
||||
<span class='line'>102</span> </span><span class="NAME">jasmine.any</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">clazz</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>103</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">jasmine.Matchers.Any</span><span class="PUNC">(</span><span class="NAME">clazz</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>104</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>105</span>
|
||||
<span class='line'>106</span> </span><span class="COMM">/**
|
||||
<span class='line'>107</span> * Jasmine Spies are test doubles that can act as stubs, spies, fakes or when used in an expecation, mocks.
|
||||
<span class='line'>108</span> *
|
||||
<span class='line'>109</span> * Spies should be created in test setup, before expectations. They can then be checked, using the standard Jasmine
|
||||
<span class='line'>110</span> * expectation syntax. Spies can be checked if they were called or not and what the calling params were.
|
||||
<span class='line'>111</span> *
|
||||
<span class='line'>112</span> * A Spy has the following mehtod: wasCalled, callCount, mostRecentCall, and argsForCall (see docs)
|
||||
<span class='line'>113</span> * Spies are torn down at the end of every spec.
|
||||
<span class='line'>114</span> *
|
||||
<span class='line'>115</span> * Note: Do <b>not</b> call new jasmine.Spy() directly - a spy must be created using spyOn, jasmine.createSpy or jasmine.createSpyObj.
|
||||
<span class='line'>116</span> *
|
||||
<span class='line'>117</span> * @example
|
||||
<span class='line'>118</span> * // a stub
|
||||
<span class='line'>119</span> * var myStub = jasmine.createSpy('myStub'); // can be used anywhere
|
||||
<span class='line'>120</span> *
|
||||
<span class='line'>121</span> * // spy example
|
||||
<span class='line'>122</span> * var foo = {
|
||||
<span class='line'>123</span> * not: function(bool) { return !bool; }
|
||||
<span class='line'>124</span> * }
|
||||
<span class='line'>125</span> *
|
||||
<span class='line'>126</span> * // actual foo.not will not be called, execution stops
|
||||
<span class='line'>127</span> * spyOn(foo, 'not');
|
||||
<span class='line'>128</span>
|
||||
<span class='line'>129</span> // foo.not spied upon, execution will continue to implementation
|
||||
<span class='line'>130</span> * spyOn(foo, 'not').andCallThrough();
|
||||
<span class='line'>131</span> *
|
||||
<span class='line'>132</span> * // fake example
|
||||
<span class='line'>133</span> * var foo = {
|
||||
<span class='line'>134</span> * not: function(bool) { return !bool; }
|
||||
<span class='line'>135</span> * }
|
||||
<span class='line'>136</span> *
|
||||
<span class='line'>137</span> * // foo.not(val) will return val
|
||||
<span class='line'>138</span> * spyOn(foo, 'not').andCallFake(function(value) {return value;});
|
||||
<span class='line'>139</span> *
|
||||
<span class='line'>140</span> * // mock example
|
||||
<span class='line'>141</span> * foo.not(7 == 7);
|
||||
<span class='line'>142</span> * expect(foo.not).wasCalled();
|
||||
<span class='line'>143</span> * expect(foo.not).wasCalledWith(true);
|
||||
<span class='line'>144</span> *
|
||||
<span class='line'>145</span> * @constructor
|
||||
<span class='line'>146</span> * @see spyOn, jasmine.createSpy, jasmine.createSpyObj
|
||||
<span class='line'>147</span> * @param {String} name
|
||||
<span class='line'>148</span> */</span><span class="WHIT">
|
||||
<span class='line'>149</span> </span><span class="NAME">jasmine.Spy</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">name</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>150</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||
<span class='line'>151</span> * The name of the spy, if provided.
|
||||
<span class='line'>152</span> */</span><span class="WHIT">
|
||||
<span class='line'>153</span> </span><span class="WHIT"> </span><span class="NAME">this.identity</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">name</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="STRN">'unknown'</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>154</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||
<span class='line'>155</span> * Is this Object a spy?
|
||||
<span class='line'>156</span> */</span><span class="WHIT">
|
||||
<span class='line'>157</span> </span><span class="WHIT"> </span><span class="NAME">this.isSpy</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>158</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||
<span class='line'>159</span> * The acutal function this spy stubs.
|
||||
<span class='line'>160</span> */</span><span class="WHIT">
|
||||
<span class='line'>161</span> </span><span class="WHIT"> </span><span class="NAME">this.plan</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>162</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||
<span class='line'>163</span> * Tracking of the most recent call to the spy.
|
||||
<span class='line'>164</span> * @example
|
||||
<span class='line'>165</span> * var mySpy = jasmine.createSpy('foo');
|
||||
<span class='line'>166</span> * mySpy(1, 2);
|
||||
<span class='line'>167</span> * mySpy.mostRecentCall.args = [1, 2];
|
||||
<span class='line'>168</span> */</span><span class="WHIT">
|
||||
<span class='line'>169</span> </span><span class="WHIT"> </span><span class="NAME">this.mostRecentCall</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>170</span>
|
||||
<span class='line'>171</span> </span><span class="WHIT"> </span><span class="COMM">/**
|
||||
<span class='line'>172</span> * Holds arguments for each call to the spy, indexed by call count
|
||||
<span class='line'>173</span> * @example
|
||||
<span class='line'>174</span> * var mySpy = jasmine.createSpy('foo');
|
||||
<span class='line'>175</span> * mySpy(1, 2);
|
||||
<span class='line'>176</span> * mySpy(7, 8);
|
||||
<span class='line'>177</span> * mySpy.mostRecentCall.args = [7, 8];
|
||||
<span class='line'>178</span> * mySpy.argsForCall[0] = [1, 2];
|
||||
<span class='line'>179</span> * mySpy.argsForCall[1] = [7, 8];
|
||||
<span class='line'>180</span> */</span><span class="WHIT">
|
||||
<span class='line'>181</span> </span><span class="WHIT"> </span><span class="NAME">this.argsForCall</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>182</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>183</span>
|
||||
<span class='line'>184</span> </span><span class="COMM">/**
|
||||
<span class='line'>185</span> * Tells a spy to call through to the actual implemenatation.
|
||||
<span class='line'>186</span> *
|
||||
<span class='line'>187</span> * @example
|
||||
<span class='line'>188</span> * var foo = {
|
||||
<span class='line'>189</span> * bar: function() { // do some stuff }
|
||||
<span class='line'>190</span> * }
|
||||
<span class='line'>191</span> *
|
||||
<span class='line'>192</span> * // defining a spy on an existing property: foo.bar
|
||||
<span class='line'>193</span> * spyOn(foo, 'bar').andCallThrough();
|
||||
<span class='line'>194</span> */</span><span class="WHIT">
|
||||
<span class='line'>195</span> </span><span class="NAME">jasmine.Spy.prototype.andCallThrough</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>196</span> </span><span class="WHIT"> </span><span class="NAME">this.plan</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.originalValue</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>197</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>198</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>199</span>
|
||||
<span class='line'>200</span> </span><span class="COMM">/**
|
||||
<span class='line'>201</span> * For setting the return value of a spy.
|
||||
<span class='line'>202</span> *
|
||||
<span class='line'>203</span> * @example
|
||||
<span class='line'>204</span> * // defining a spy from scratch: foo() returns 'baz'
|
||||
<span class='line'>205</span> * var foo = jasmine.createSpy('spy on foo').andReturn('baz');
|
||||
<span class='line'>206</span> *
|
||||
<span class='line'>207</span> * // defining a spy on an existing property: foo.bar() returns 'baz'
|
||||
<span class='line'>208</span> * spyOn(foo, 'bar').andReturn('baz');
|
||||
<span class='line'>209</span> *
|
||||
<span class='line'>210</span> * @param {Object} value
|
||||
<span class='line'>211</span> */</span><span class="WHIT">
|
||||
<span class='line'>212</span> </span><span class="NAME">jasmine.Spy.prototype.andReturn</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">value</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>213</span> </span><span class="WHIT"> </span><span class="NAME">this.plan</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>214</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>215</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>216</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>217</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>218</span>
|
||||
<span class='line'>219</span> </span><span class="COMM">/**
|
||||
<span class='line'>220</span> * For throwing an exception when a spy is called.
|
||||
<span class='line'>221</span> *
|
||||
<span class='line'>222</span> * @example
|
||||
<span class='line'>223</span> * // defining a spy from scratch: foo() throws an exception w/ message 'ouch'
|
||||
<span class='line'>224</span> * var foo = jasmine.createSpy('spy on foo').andThrow('baz');
|
||||
<span class='line'>225</span> *
|
||||
<span class='line'>226</span> * // defining a spy on an existing property: foo.bar() throws an exception w/ message 'ouch'
|
||||
<span class='line'>227</span> * spyOn(foo, 'bar').andThrow('baz');
|
||||
<span class='line'>228</span> *
|
||||
<span class='line'>229</span> * @param {String} exceptionMsg
|
||||
<span class='line'>230</span> */</span><span class="WHIT">
|
||||
<span class='line'>231</span> </span><span class="NAME">jasmine.Spy.prototype.andThrow</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">exceptionMsg</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>232</span> </span><span class="WHIT"> </span><span class="NAME">this.plan</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>233</span> </span><span class="WHIT"> </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="NAME">exceptionMsg</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>234</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>235</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>236</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>237</span>
|
||||
<span class='line'>238</span> </span><span class="COMM">/**
|
||||
<span class='line'>239</span> * Calls an alternate implementation when a spy is called.
|
||||
<span class='line'>240</span> *
|
||||
<span class='line'>241</span> * @example
|
||||
<span class='line'>242</span> * var baz = function() {
|
||||
<span class='line'>243</span> * // do some stuff, return something
|
||||
<span class='line'>244</span> * }
|
||||
<span class='line'>245</span> * // defining a spy from scratch: foo() calls the function baz
|
||||
<span class='line'>246</span> * var foo = jasmine.createSpy('spy on foo').andCall(baz);
|
||||
<span class='line'>247</span> *
|
||||
<span class='line'>248</span> * // defining a spy on an existing property: foo.bar() calls an anonymnous function
|
||||
<span class='line'>249</span> * spyOn(foo, 'bar').andCall(function() { return 'baz';} );
|
||||
<span class='line'>250</span> *
|
||||
<span class='line'>251</span> * @param {Function} fakeFunc
|
||||
<span class='line'>252</span> */</span><span class="WHIT">
|
||||
<span class='line'>253</span> </span><span class="NAME">jasmine.Spy.prototype.andCallFake</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">fakeFunc</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>254</span> </span><span class="WHIT"> </span><span class="NAME">this.plan</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">fakeFunc</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>255</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>256</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>257</span>
|
||||
<span class='line'>258</span> </span><span class="COMM">/**
|
||||
<span class='line'>259</span> * Resets all of a spy's the tracking variables so that it can be used again.
|
||||
<span class='line'>260</span> *
|
||||
<span class='line'>261</span> * @example
|
||||
<span class='line'>262</span> * spyOn(foo, 'bar');
|
||||
<span class='line'>263</span> *
|
||||
<span class='line'>264</span> * foo.bar();
|
||||
<span class='line'>265</span> *
|
||||
<span class='line'>266</span> * expect(foo.bar.callCount).toEqual(1);
|
||||
<span class='line'>267</span> *
|
||||
<span class='line'>268</span> * foo.bar.reset();
|
||||
<span class='line'>269</span> *
|
||||
<span class='line'>270</span> * expect(foo.bar.callCount).toEqual(0);
|
||||
<span class='line'>271</span> */</span><span class="WHIT">
|
||||
<span class='line'>272</span> </span><span class="NAME">jasmine.Spy.prototype.reset</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>273</span> </span><span class="WHIT"> </span><span class="NAME">this.wasCalled</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>274</span> </span><span class="WHIT"> </span><span class="NAME">this.callCount</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>275</span> </span><span class="WHIT"> </span><span class="NAME">this.argsForCall</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>276</span> </span><span class="WHIT"> </span><span class="NAME">this.mostRecentCall</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>277</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>278</span>
|
||||
<span class='line'>279</span> </span><span class="NAME">jasmine.createSpy</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">name</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>280</span>
|
||||
<span class='line'>281</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">spyObj</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>282</span> </span><span class="WHIT"> </span><span class="NAME">spyObj.wasCalled</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>283</span> </span><span class="WHIT"> </span><span class="NAME">spyObj.callCount</span><span class="PUNC">++</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>284</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">args</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">jasmine.util.argsToArray</span><span class="PUNC">(</span><span class="NAME">arguments</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>285</span> </span><span class="WHIT"> </span><span class="COMM">//spyObj.mostRecentCall = {</span><span class="WHIT">
|
||||
<span class='line'>286</span> </span><span class="WHIT"> </span><span class="COMM">// object: this,</span><span class="WHIT">
|
||||
<span class='line'>287</span> </span><span class="WHIT"> </span><span class="COMM">// args: args</span><span class="WHIT">
|
||||
<span class='line'>288</span> </span><span class="WHIT"> </span><span class="COMM">//};</span><span class="WHIT">
|
||||
<span class='line'>289</span> </span><span class="WHIT"> </span><span class="NAME">spyObj.mostRecentCall.object</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>290</span> </span><span class="WHIT"> </span><span class="NAME">spyObj.mostRecentCall.args</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">args</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>291</span> </span><span class="WHIT"> </span><span class="NAME">spyObj.argsForCall.push</span><span class="PUNC">(</span><span class="NAME">args</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>292</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">spyObj.plan.apply</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">arguments</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>293</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>294</span>
|
||||
<span class='line'>295</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">spy</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">jasmine.Spy</span><span class="PUNC">(</span><span class="NAME">name</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>296</span> </span><span class="WHIT">
|
||||
<span class='line'>297</span> </span><span class="KEYW">for</span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">prop</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">spy</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>298</span> </span><span class="WHIT"> </span><span class="NAME">spyObj</span><span class="PUNC">[</span><span class="NAME">prop</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">spy</span><span class="PUNC">[</span><span class="NAME">prop</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>299</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>300</span> </span><span class="WHIT">
|
||||
<span class='line'>301</span> </span><span class="NAME">spyObj.reset</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>302</span>
|
||||
<span class='line'>303</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">spyObj</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>304</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>305</span>
|
||||
<span class='line'>306</span> </span><span class="COMM">/**
|
||||
<span class='line'>307</span> * Creates a more complicated spy: an Object that has every property a function that is a spy. Used for stubbing something
|
||||
<span class='line'>308</span> * large in one call.
|
||||
<span class='line'>309</span> *
|
||||
<span class='line'>310</span> * @param {String} baseName name of spy class
|
||||
<span class='line'>311</span> * @param {Array} methodNames array of names of methods to make spies
|
||||
<span class='line'>312</span> */</span><span class="WHIT">
|
||||
<span class='line'>313</span> </span><span class="NAME">jasmine.createSpyObj</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">baseName</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">methodNames</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>314</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">obj</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>315</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC"><</span><span class="WHIT"> </span><span class="NAME">methodNames.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>316</span> </span><span class="WHIT"> </span><span class="NAME">obj</span><span class="PUNC">[</span><span class="NAME">methodNames</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">jasmine.createSpy</span><span class="PUNC">(</span><span class="NAME">baseName</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'.'</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">methodNames</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>317</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>318</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">obj</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>319</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>320</span>
|
||||
<span class='line'>321</span> </span><span class="NAME">jasmine.log</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">message</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>322</span> </span><span class="WHIT"> </span><span class="NAME">jasmine.getEnv</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">currentSpec.getResults</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">log</span><span class="PUNC">(</span><span class="NAME">message</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>323</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>324</span>
|
||||
<span class='line'>325</span> </span><span class="COMM">/**
|
||||
<span class='line'>326</span> * Function that installs a spy on an existing object's method name. Used within a Spec to create a spy.
|
||||
<span class='line'>327</span> *
|
||||
<span class='line'>328</span> * @example
|
||||
<span class='line'>329</span> * // spy example
|
||||
<span class='line'>330</span> * var foo = {
|
||||
<span class='line'>331</span> * not: function(bool) { return !bool; }
|
||||
<span class='line'>332</span> * }
|
||||
<span class='line'>333</span> * spyOn(foo, 'not'); // actual foo.not will not be called, execution stops
|
||||
<span class='line'>334</span> *
|
||||
<span class='line'>335</span> * @see jasmine.createSpy
|
||||
<span class='line'>336</span> * @param obj
|
||||
<span class='line'>337</span> * @param methodName
|
||||
<span class='line'>338</span> * @returns a Jasmine spy that can be chained with all spy methods
|
||||
<span class='line'>339</span> */</span><span class="WHIT">
|
||||
<span class='line'>340</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">spyOn</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">obj</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">methodName</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>341</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">jasmine.getEnv</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">currentSpec.spyOn</span><span class="PUNC">(</span><span class="NAME">obj</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">methodName</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>342</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>343</span>
|
||||
<span class='line'>344</span> </span><span class="COMM">/**
|
||||
<span class='line'>345</span> * Creates a Jasmine spec that will be added to the current suite.
|
||||
<span class='line'>346</span> *
|
||||
<span class='line'>347</span> * // TODO: pending tests
|
||||
<span class='line'>348</span> *
|
||||
<span class='line'>349</span> * @example
|
||||
<span class='line'>350</span> * it('should be true', function() {
|
||||
<span class='line'>351</span> * expect(true).toEqual(true);
|
||||
<span class='line'>352</span> * });
|
||||
<span class='line'>353</span> *
|
||||
<span class='line'>354</span> * @param {String} desc description of this specification
|
||||
<span class='line'>355</span> * @param {Function} func defines the preconditions and expectations of the spec
|
||||
<span class='line'>356</span> */</span><span class="WHIT">
|
||||
<span class='line'>357</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">it</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">desc</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">func</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>358</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">jasmine.getEnv</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">it</span><span class="PUNC">(</span><span class="NAME">desc</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">func</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>359</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>360</span>
|
||||
<span class='line'>361</span> </span><span class="COMM">/**
|
||||
<span class='line'>362</span> * Creates a <em>disabled</em> Jasmine spec.
|
||||
<span class='line'>363</span> *
|
||||
<span class='line'>364</span> * A convenience method that allows existing specs to be disabled temporarily during development.
|
||||
<span class='line'>365</span> *
|
||||
<span class='line'>366</span> * @param {String} desc description of this specification
|
||||
<span class='line'>367</span> * @param {Function} func defines the preconditions and expectations of the spec
|
||||
<span class='line'>368</span> */</span><span class="WHIT">
|
||||
<span class='line'>369</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">xit</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">desc</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">func</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>370</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">jasmine.getEnv</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">xit</span><span class="PUNC">(</span><span class="NAME">desc</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">func</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>371</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>372</span>
|
||||
<span class='line'>373</span> </span><span class="COMM">/**
|
||||
<span class='line'>374</span> * Starts a chain for a Jasmine expectation.
|
||||
<span class='line'>375</span> *
|
||||
<span class='line'>376</span> * It is passed an Object that is the actual value and should chain to one of the many
|
||||
<span class='line'>377</span> * jasmine.Matchers functions.
|
||||
<span class='line'>378</span> *
|
||||
<span class='line'>379</span> * @param {Object} actual Actual value to test against and expected value
|
||||
<span class='line'>380</span> */</span><span class="WHIT">
|
||||
<span class='line'>381</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">expect</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">actual</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>382</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">jasmine.getEnv</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">currentSpec.expect</span><span class="PUNC">(</span><span class="NAME">actual</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>383</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>384</span>
|
||||
<span class='line'>385</span> </span><span class="COMM">/**
|
||||
<span class='line'>386</span> * Defines part of a jasmine spec. Used in cominbination with waits or waitsFor in asynchrnous specs.
|
||||
<span class='line'>387</span> *
|
||||
<span class='line'>388</span> * @param {Function} func Function that defines part of a jasmine spec.
|
||||
<span class='line'>389</span> */</span><span class="WHIT">
|
||||
<span class='line'>390</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">runs</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">func</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>391</span> </span><span class="WHIT"> </span><span class="NAME">jasmine.getEnv</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">currentSpec.runs</span><span class="PUNC">(</span><span class="NAME">func</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>392</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>393</span>
|
||||
<span class='line'>394</span> </span><span class="COMM">/**
|
||||
<span class='line'>395</span> * Waits for a timeout before moving to the next runs()-defined block.
|
||||
<span class='line'>396</span> * @param {Number} timeout
|
||||
<span class='line'>397</span> */</span><span class="WHIT">
|
||||
<span class='line'>398</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">waits</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">timeout</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>399</span> </span><span class="WHIT"> </span><span class="NAME">jasmine.getEnv</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">currentSpec.waits</span><span class="PUNC">(</span><span class="NAME">timeout</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>400</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>401</span>
|
||||
<span class='line'>402</span> </span><span class="COMM">/**
|
||||
<span class='line'>403</span> * Waits for the latchFunction to return true before proceeding to the next runs()-defined block.
|
||||
<span class='line'>404</span> *
|
||||
<span class='line'>405</span> * @param {Number} timeout
|
||||
<span class='line'>406</span> * @param {Function} latchFunction
|
||||
<span class='line'>407</span> * @param {String} message
|
||||
<span class='line'>408</span> */</span><span class="WHIT">
|
||||
<span class='line'>409</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">waitsFor</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">timeout</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">latchFunction</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">message</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>410</span> </span><span class="WHIT"> </span><span class="NAME">jasmine.getEnv</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">currentSpec.waitsFor</span><span class="PUNC">(</span><span class="NAME">timeout</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">latchFunction</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">message</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>411</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>412</span>
|
||||
<span class='line'>413</span> </span><span class="COMM">/**
|
||||
<span class='line'>414</span> * A function that is called before each spec in a suite.
|
||||
<span class='line'>415</span> *
|
||||
<span class='line'>416</span> * Used for spec setup, including validating assumptions.
|
||||
<span class='line'>417</span> *
|
||||
<span class='line'>418</span> * @param {Function} beforeEachFunction
|
||||
<span class='line'>419</span> */</span><span class="WHIT">
|
||||
<span class='line'>420</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">beforeEach</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">beforeEachFunction</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>421</span> </span><span class="WHIT"> </span><span class="NAME">jasmine.getEnv</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">beforeEach</span><span class="PUNC">(</span><span class="NAME">beforeEachFunction</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>422</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>423</span>
|
||||
<span class='line'>424</span> </span><span class="COMM">/**
|
||||
<span class='line'>425</span> * A function that is called after each spec in a suite.
|
||||
<span class='line'>426</span> *
|
||||
<span class='line'>427</span> * Used for restoring any state that is hijacked during spec execution.
|
||||
<span class='line'>428</span> *
|
||||
<span class='line'>429</span> * @param {Function} afterEachFunction
|
||||
<span class='line'>430</span> */</span><span class="WHIT">
|
||||
<span class='line'>431</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">afterEach</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">afterEachFunction</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>432</span> </span><span class="WHIT"> </span><span class="NAME">jasmine.getEnv</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">afterEach</span><span class="PUNC">(</span><span class="NAME">afterEachFunction</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>433</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>434</span>
|
||||
<span class='line'>435</span> </span><span class="COMM">/**
|
||||
<span class='line'>436</span> * Defines a suite of specifications.
|
||||
<span class='line'>437</span> *
|
||||
<span class='line'>438</span> * Stores the description and all defined specs in the Jasmine environment as one suite of specs. Variables declared
|
||||
<span class='line'>439</span> * are accessible by calls to beforeEach, it, and afterEach. Describe blocks can be nested, allowing for specialization
|
||||
<span class='line'>440</span> * of setup in some tests.
|
||||
<span class='line'>441</span> *
|
||||
<span class='line'>442</span> * @example
|
||||
<span class='line'>443</span> * // TODO: a simple suite
|
||||
<span class='line'>444</span> *
|
||||
<span class='line'>445</span> * // TODO: a simple suite with a nested describe block
|
||||
<span class='line'>446</span> *
|
||||
<span class='line'>447</span> * @param {String} description A string, usually the class under test.
|
||||
<span class='line'>448</span> * @param {Function} specDefinitions function that defines several specs.
|
||||
<span class='line'>449</span> */</span><span class="WHIT">
|
||||
<span class='line'>450</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">describe</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">description</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">specDefinitions</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>451</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">jasmine.getEnv</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">describe</span><span class="PUNC">(</span><span class="NAME">description</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">specDefinitions</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>452</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>453</span>
|
||||
<span class='line'>454</span> </span><span class="COMM">/**
|
||||
<span class='line'>455</span> * Disables a suite of specifications. Used to disable some suites in a file, or files, temporarily during development.
|
||||
<span class='line'>456</span> *
|
||||
<span class='line'>457</span> * @param {String} description A string, usually the class under test.
|
||||
<span class='line'>458</span> * @param {Function} specDefinitions function that defines several specs.
|
||||
<span class='line'>459</span> */</span><span class="WHIT">
|
||||
<span class='line'>460</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">xdescribe</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">description</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">specDefinitions</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>461</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">jasmine.getEnv</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">xdescribe</span><span class="PUNC">(</span><span class="NAME">description</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">specDefinitions</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>462</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>463</span>
|
||||
<span class='line'>464</span>
|
||||
<span class='line'>465</span> </span><span class="NAME">jasmine.XmlHttpRequest</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">XMLHttpRequest</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>466</span>
|
||||
<span class='line'>467</span> </span><span class="COMM">// Provide the XMLHttpRequest class for IE 5.x-6.x:</span><span class="WHIT">
|
||||
<span class='line'>468</span> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">XMLHttpRequest</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">jasmine.XmlHttpRequest</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>469</span> </span><span class="WHIT"> </span><span class="KEYW">try</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>470</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">ActiveXObject</span><span class="PUNC">(</span><span class="STRN">"Msxml2.XMLHTTP.6.0"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>471</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">catch</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>472</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>473</span> </span><span class="WHIT"> </span><span class="KEYW">try</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>474</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">ActiveXObject</span><span class="PUNC">(</span><span class="STRN">"Msxml2.XMLHTTP.3.0"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>475</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">catch</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>476</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>477</span> </span><span class="WHIT"> </span><span class="KEYW">try</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>478</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">ActiveXObject</span><span class="PUNC">(</span><span class="STRN">"Msxml2.XMLHTTP"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>479</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">catch</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>480</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>481</span> </span><span class="WHIT"> </span><span class="KEYW">try</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>482</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">ActiveXObject</span><span class="PUNC">(</span><span class="STRN">"Microsoft.XMLHTTP"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>483</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">catch</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>484</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>485</span> </span><span class="WHIT"> </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Error</span><span class="PUNC">(</span><span class="STRN">"This browser does not support XMLHttpRequest."</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>486</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>487</span>
|
||||
<span class='line'>488</span> </span><span class="COMM">/**
|
||||
<span class='line'>489</span> * Adds suite files to an HTML document so that they are executed, thus adding them to the current
|
||||
<span class='line'>490</span> * Jasmine environment.
|
||||
<span class='line'>491</span> *
|
||||
<span class='line'>492</span> * @param {String} url path to the file to include
|
||||
<span class='line'>493</span> * @param {Boolean} opt_global
|
||||
<span class='line'>494</span> */</span><span class="WHIT">
|
||||
<span class='line'>495</span> </span><span class="NAME">jasmine.include</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">url</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">opt_global</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>496</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">opt_global</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>497</span> </span><span class="WHIT"> </span><span class="NAME">document.write</span><span class="PUNC">(</span><span class="STRN">'<script type="text/javascript" src="'</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">url</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'"></'</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'script>'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>498</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>499</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">xhr</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>500</span> </span><span class="WHIT"> </span><span class="KEYW">try</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>501</span> </span><span class="WHIT"> </span><span class="NAME">xhr</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">jasmine.XmlHttpRequest</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>502</span> </span><span class="WHIT"> </span><span class="NAME">xhr.open</span><span class="PUNC">(</span><span class="STRN">"GET"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">url</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>503</span> </span><span class="WHIT"> </span><span class="NAME">xhr.send</span><span class="PUNC">(</span><span class="KEYW">null</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>504</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">catch</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>505</span> </span><span class="WHIT"> </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Error</span><span class="PUNC">(</span><span class="STRN">"couldn't fetch "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">url</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">": "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">e</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>506</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>507</span>
|
||||
<span class='line'>508</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">eval</span><span class="PUNC">(</span><span class="NAME">xhr.responseText</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>509</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>510</span> </span><span class="PUNC">}</span><span class="PUNC">;</span></pre></body></html>
|
|
@ -1,89 +0,0 @@
|
|||
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
|
||||
.KEYW {color: #933;}
|
||||
.COMM {color: #bbb; font-style: italic;}
|
||||
.NUMB {color: #393;}
|
||||
.STRN {color: #393;}
|
||||
.REGX {color: #339;}
|
||||
.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
|
||||
</style></head><body><pre><span class='line'> 1</span> <span class="COMM">// Mock setTimeout, clearTimeout</span><span class="WHIT">
|
||||
<span class='line'> 2</span> </span><span class="COMM">// Contributed by Pivotal Computer Systems, www.pivotalsf.com</span><span class="WHIT">
|
||||
<span class='line'> 3</span>
|
||||
<span class='line'> 4</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">Clock</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 5</span> </span><span class="WHIT"> </span><span class="NAME">timeoutsMade</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'> 6</span> </span><span class="WHIT"> </span><span class="NAME">scheduledFunctions</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'> 7</span> </span><span class="WHIT"> </span><span class="NAME">nowMillis</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'> 8</span> </span><span class="WHIT"> </span><span class="NAME">reset</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 9</span> </span><span class="WHIT"> </span><span class="NAME">this.scheduledFunctions</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 10</span> </span><span class="WHIT"> </span><span class="NAME">this.nowMillis</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 11</span> </span><span class="WHIT"> </span><span class="NAME">this.timeoutsMade</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 12</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'> 13</span> </span><span class="WHIT"> </span><span class="NAME">tick</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">millis</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 14</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">oldMillis</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.nowMillis</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 15</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">newMillis</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">oldMillis</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">millis</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 16</span> </span><span class="WHIT"> </span><span class="NAME">this.runFunctionsWithinRange</span><span class="PUNC">(</span><span class="NAME">oldMillis</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">newMillis</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 17</span> </span><span class="WHIT"> </span><span class="NAME">this.nowMillis</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">newMillis</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 18</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'> 19</span> </span><span class="WHIT"> </span><span class="NAME">runFunctionsWithinRange</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">oldMillis</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">nowMillis</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 20</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">scheduledFunc</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 21</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">funcsToRun</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 22</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">timeoutKey</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">this.scheduledFunctions</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 23</span> </span><span class="WHIT"> </span><span class="NAME">scheduledFunc</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.scheduledFunctions</span><span class="PUNC">[</span><span class="NAME">timeoutKey</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 24</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">scheduledFunc</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT">
|
||||
<span class='line'> 25</span> </span><span class="WHIT"> </span><span class="NAME">scheduledFunc.runAtMillis</span><span class="WHIT"> </span><span class="PUNC">>=</span><span class="WHIT"> </span><span class="NAME">oldMillis</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT">
|
||||
<span class='line'> 26</span> </span><span class="WHIT"> </span><span class="NAME">scheduledFunc.runAtMillis</span><span class="WHIT"> </span><span class="PUNC"><=</span><span class="WHIT"> </span><span class="NAME">nowMillis</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 27</span> </span><span class="WHIT"> </span><span class="NAME">funcsToRun.push</span><span class="PUNC">(</span><span class="NAME">scheduledFunc</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 28</span> </span><span class="WHIT"> </span><span class="NAME">this.scheduledFunctions</span><span class="PUNC">[</span><span class="NAME">timeoutKey</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 29</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 30</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 31</span>
|
||||
<span class='line'> 32</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">funcsToRun.length</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 33</span> </span><span class="WHIT"> </span><span class="NAME">funcsToRun.sort</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">a</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">b</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 34</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">a.runAtMillis</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">b.runAtMillis</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 35</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 36</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC"><</span><span class="WHIT"> </span><span class="NAME">funcsToRun.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">++</span><span class="NAME">i</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 37</span> </span><span class="WHIT"> </span><span class="KEYW">try</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 38</span> </span><span class="WHIT"> </span><span class="NAME">this.nowMillis</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">funcsToRun</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">runAtMillis</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 39</span> </span><span class="WHIT"> </span><span class="NAME">funcsToRun</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">funcToCall</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 40</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">funcsToRun</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">recurring</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 41</span> </span><span class="WHIT"> </span><span class="NAME">Clock.scheduleFunction</span><span class="PUNC">(</span><span class="NAME">funcsToRun</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">timeoutKey</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'> 42</span> </span><span class="WHIT"> </span><span class="NAME">funcsToRun</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">funcToCall</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'> 43</span> </span><span class="WHIT"> </span><span class="NAME">funcsToRun</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">millis</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'> 44</span> </span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 45</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 46</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">catch</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 47</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 48</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 49</span> </span><span class="WHIT"> </span><span class="NAME">this.runFunctionsWithinRange</span><span class="PUNC">(</span><span class="NAME">oldMillis</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">nowMillis</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 50</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 51</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'> 52</span> </span><span class="WHIT"> </span><span class="NAME">scheduleFunction</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">timeoutKey</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">funcToCall</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">millis</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">recurring</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 53</span> </span><span class="WHIT"> </span><span class="NAME">Clock.scheduledFunctions</span><span class="PUNC">[</span><span class="NAME">timeoutKey</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 54</span> </span><span class="WHIT"> </span><span class="NAME">runAtMillis</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">Clock.nowMillis</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">millis</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'> 55</span> </span><span class="WHIT"> </span><span class="NAME">funcToCall</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">funcToCall</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'> 56</span> </span><span class="WHIT"> </span><span class="NAME">recurring</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">recurring</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'> 57</span> </span><span class="WHIT"> </span><span class="NAME">timeoutKey</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">timeoutKey</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'> 58</span> </span><span class="WHIT"> </span><span class="NAME">millis</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">millis</span><span class="WHIT">
|
||||
<span class='line'> 59</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 60</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 61</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 62</span>
|
||||
<span class='line'> 63</span> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">setTimeout</span><span class="PUNC">(</span><span class="NAME">funcToCall</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">millis</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 64</span> </span><span class="WHIT"> </span><span class="NAME">Clock.timeoutsMade</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Clock.timeoutsMade</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 65</span> </span><span class="WHIT"> </span><span class="NAME">Clock.scheduleFunction</span><span class="PUNC">(</span><span class="NAME">Clock.timeoutsMade</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">funcToCall</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">millis</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 66</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">Clock.timeoutsMade</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 67</span> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 68</span>
|
||||
<span class='line'> 69</span> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">setInterval</span><span class="PUNC">(</span><span class="NAME">funcToCall</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">millis</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 70</span> </span><span class="WHIT"> </span><span class="NAME">Clock.timeoutsMade</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Clock.timeoutsMade</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 71</span> </span><span class="WHIT"> </span><span class="NAME">Clock.scheduleFunction</span><span class="PUNC">(</span><span class="NAME">Clock.timeoutsMade</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">funcToCall</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">millis</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 72</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">Clock.timeoutsMade</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 73</span> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 74</span>
|
||||
<span class='line'> 75</span> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">clearTimeout</span><span class="PUNC">(</span><span class="NAME">timeoutKey</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 76</span> </span><span class="WHIT"> </span><span class="NAME">Clock.scheduledFunctions</span><span class="PUNC">[</span><span class="NAME">timeoutKey</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 77</span> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 78</span>
|
||||
<span class='line'> 79</span> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">clearInterval</span><span class="PUNC">(</span><span class="NAME">timeoutKey</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 80</span> </span><span class="WHIT"> </span><span class="NAME">Clock.scheduledFunctions</span><span class="PUNC">[</span><span class="NAME">timeoutKey</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 81</span> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 82</span> </span></pre></body></html>
|
|
@ -1,166 +0,0 @@
|
|||
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
|
||||
.KEYW {color: #933;}
|
||||
.COMM {color: #bbb; font-style: italic;}
|
||||
.NUMB {color: #393;}
|
||||
.STRN {color: #393;}
|
||||
.REGX {color: #339;}
|
||||
.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
|
||||
</style></head><body><pre><span class='line'> 1</span> <span class="COMM">// Mock setTimeout, clearTimeout</span><span class="WHIT">
|
||||
<span class='line'> 2</span> </span><span class="COMM">// Contributed by Pivotal Computer Systems, www.pivotalsf.com</span><span class="WHIT">
|
||||
<span class='line'> 3</span>
|
||||
<span class='line'> 4</span> </span><span class="NAME">jasmine.FakeTimer</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 5</span> </span><span class="WHIT"> </span><span class="NAME">this.reset</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 6</span>
|
||||
<span class='line'> 7</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">self</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 8</span> </span><span class="WHIT"> </span><span class="NAME">self.setTimeout</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">funcToCall</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">millis</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 9</span> </span><span class="WHIT"> </span><span class="NAME">self.timeoutsMade</span><span class="PUNC">++</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 10</span> </span><span class="WHIT"> </span><span class="NAME">self.scheduleFunction</span><span class="PUNC">(</span><span class="NAME">self.timeoutsMade</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">funcToCall</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">millis</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 11</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">self.timeoutsMade</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 12</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 13</span>
|
||||
<span class='line'> 14</span> </span><span class="WHIT"> </span><span class="NAME">self.setInterval</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">funcToCall</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">millis</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 15</span> </span><span class="WHIT"> </span><span class="NAME">self.timeoutsMade</span><span class="PUNC">++</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 16</span> </span><span class="WHIT"> </span><span class="NAME">self.scheduleFunction</span><span class="PUNC">(</span><span class="NAME">self.timeoutsMade</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">funcToCall</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">millis</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 17</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">self.timeoutsMade</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 18</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 19</span>
|
||||
<span class='line'> 20</span> </span><span class="WHIT"> </span><span class="NAME">self.clearTimeout</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">timeoutKey</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 21</span> </span><span class="WHIT"> </span><span class="NAME">self.scheduledFunctions</span><span class="PUNC">[</span><span class="NAME">timeoutKey</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 22</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 23</span>
|
||||
<span class='line'> 24</span> </span><span class="WHIT"> </span><span class="NAME">self.clearInterval</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">timeoutKey</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 25</span> </span><span class="WHIT"> </span><span class="NAME">self.scheduledFunctions</span><span class="PUNC">[</span><span class="NAME">timeoutKey</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 26</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 27</span>
|
||||
<span class='line'> 28</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 29</span>
|
||||
<span class='line'> 30</span> </span><span class="NAME">jasmine.FakeTimer.prototype.reset</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 31</span> </span><span class="WHIT"> </span><span class="NAME">this.timeoutsMade</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 32</span> </span><span class="WHIT"> </span><span class="NAME">this.scheduledFunctions</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 33</span> </span><span class="WHIT"> </span><span class="NAME">this.nowMillis</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 34</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 35</span>
|
||||
<span class='line'> 36</span> </span><span class="NAME">jasmine.FakeTimer.prototype.tick</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">millis</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 37</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">oldMillis</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.nowMillis</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 38</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">newMillis</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">oldMillis</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">millis</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 39</span> </span><span class="WHIT"> </span><span class="NAME">this.runFunctionsWithinRange</span><span class="PUNC">(</span><span class="NAME">oldMillis</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">newMillis</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 40</span> </span><span class="WHIT"> </span><span class="NAME">this.nowMillis</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">newMillis</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 41</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 42</span>
|
||||
<span class='line'> 43</span> </span><span class="NAME">jasmine.FakeTimer.prototype.runFunctionsWithinRange</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">oldMillis</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">nowMillis</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 44</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">scheduledFunc</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 45</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">funcsToRun</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 46</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">timeoutKey</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">this.scheduledFunctions</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 47</span> </span><span class="WHIT"> </span><span class="NAME">scheduledFunc</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.scheduledFunctions</span><span class="PUNC">[</span><span class="NAME">timeoutKey</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 48</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">scheduledFunc</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT">
|
||||
<span class='line'> 49</span> </span><span class="WHIT"> </span><span class="NAME">scheduledFunc.runAtMillis</span><span class="WHIT"> </span><span class="PUNC">>=</span><span class="WHIT"> </span><span class="NAME">oldMillis</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT">
|
||||
<span class='line'> 50</span> </span><span class="WHIT"> </span><span class="NAME">scheduledFunc.runAtMillis</span><span class="WHIT"> </span><span class="PUNC"><=</span><span class="WHIT"> </span><span class="NAME">nowMillis</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 51</span> </span><span class="WHIT"> </span><span class="NAME">funcsToRun.push</span><span class="PUNC">(</span><span class="NAME">scheduledFunc</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 52</span> </span><span class="WHIT"> </span><span class="NAME">this.scheduledFunctions</span><span class="PUNC">[</span><span class="NAME">timeoutKey</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 53</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 54</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 55</span>
|
||||
<span class='line'> 56</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">funcsToRun.length</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 57</span> </span><span class="WHIT"> </span><span class="NAME">funcsToRun.sort</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">a</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">b</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 58</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">a.runAtMillis</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">b.runAtMillis</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 59</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 60</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC"><</span><span class="WHIT"> </span><span class="NAME">funcsToRun.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">++</span><span class="NAME">i</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 61</span> </span><span class="WHIT"> </span><span class="KEYW">try</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 62</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">funcToRun</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">funcsToRun</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 63</span> </span><span class="WHIT"> </span><span class="NAME">this.nowMillis</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">funcToRun.runAtMillis</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 64</span> </span><span class="WHIT"> </span><span class="NAME">funcToRun.funcToCall</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 65</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">funcToRun.recurring</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 66</span> </span><span class="WHIT"> </span><span class="NAME">this.scheduleFunction</span><span class="PUNC">(</span><span class="NAME">funcToRun.timeoutKey</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'> 67</span> </span><span class="WHIT"> </span><span class="NAME">funcToRun.funcToCall</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'> 68</span> </span><span class="WHIT"> </span><span class="NAME">funcToRun.millis</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'> 69</span> </span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 70</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 71</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">catch</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 72</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 73</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 74</span> </span><span class="WHIT"> </span><span class="NAME">this.runFunctionsWithinRange</span><span class="PUNC">(</span><span class="NAME">oldMillis</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">nowMillis</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 75</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 76</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 77</span>
|
||||
<span class='line'> 78</span> </span><span class="NAME">jasmine.FakeTimer.prototype.scheduleFunction</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">timeoutKey</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">funcToCall</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">millis</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">recurring</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 79</span> </span><span class="WHIT"> </span><span class="NAME">this.scheduledFunctions</span><span class="PUNC">[</span><span class="NAME">timeoutKey</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 80</span> </span><span class="WHIT"> </span><span class="NAME">runAtMillis</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.nowMillis</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">millis</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'> 81</span> </span><span class="WHIT"> </span><span class="NAME">funcToCall</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">funcToCall</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'> 82</span> </span><span class="WHIT"> </span><span class="NAME">recurring</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">recurring</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'> 83</span> </span><span class="WHIT"> </span><span class="NAME">timeoutKey</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">timeoutKey</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'> 84</span> </span><span class="WHIT"> </span><span class="NAME">millis</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">millis</span><span class="WHIT">
|
||||
<span class='line'> 85</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 86</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 87</span>
|
||||
<span class='line'> 88</span>
|
||||
<span class='line'> 89</span> </span><span class="NAME">jasmine.Clock</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 90</span> </span><span class="WHIT"> </span><span class="NAME">defaultFakeTimer</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">jasmine.FakeTimer</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'> 91</span>
|
||||
<span class='line'> 92</span> </span><span class="WHIT"> </span><span class="NAME">reset</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 93</span> </span><span class="WHIT"> </span><span class="NAME">jasmine.Clock.assertInstalled</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 94</span> </span><span class="WHIT"> </span><span class="NAME">jasmine.Clock.defaultFakeTimer.reset</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 95</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'> 96</span>
|
||||
<span class='line'> 97</span> </span><span class="WHIT"> </span><span class="NAME">tick</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">millis</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 98</span> </span><span class="WHIT"> </span><span class="NAME">jasmine.Clock.assertInstalled</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 99</span> </span><span class="WHIT"> </span><span class="NAME">jasmine.Clock.defaultFakeTimer.tick</span><span class="PUNC">(</span><span class="NAME">millis</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>100</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'>101</span>
|
||||
<span class='line'>102</span> </span><span class="WHIT"> </span><span class="NAME">runFunctionsWithinRange</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">oldMillis</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">nowMillis</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>103</span> </span><span class="WHIT"> </span><span class="NAME">jasmine.Clock.defaultFakeTimer.runFunctionsWithinRange</span><span class="PUNC">(</span><span class="NAME">oldMillis</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">nowMillis</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>104</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'>105</span>
|
||||
<span class='line'>106</span> </span><span class="WHIT"> </span><span class="NAME">scheduleFunction</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">timeoutKey</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">funcToCall</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">millis</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">recurring</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>107</span> </span><span class="WHIT"> </span><span class="NAME">jasmine.Clock.defaultFakeTimer.scheduleFunction</span><span class="PUNC">(</span><span class="NAME">timeoutKey</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">funcToCall</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">millis</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">recurring</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>108</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'>109</span>
|
||||
<span class='line'>110</span> </span><span class="WHIT"> </span><span class="NAME">useMock</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>111</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">spec</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">jasmine.getEnv</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">currentSpec</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>112</span> </span><span class="WHIT"> </span><span class="NAME">spec.after</span><span class="PUNC">(</span><span class="NAME">jasmine.Clock.uninstallMock</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>113</span>
|
||||
<span class='line'>114</span> </span><span class="WHIT"> </span><span class="NAME">jasmine.Clock.installMock</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>115</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'>116</span>
|
||||
<span class='line'>117</span> </span><span class="WHIT"> </span><span class="NAME">installMock</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>118</span> </span><span class="WHIT"> </span><span class="NAME">jasmine.Clock.installed</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">jasmine.Clock.defaultFakeTimer</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>119</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'>120</span>
|
||||
<span class='line'>121</span> </span><span class="WHIT"> </span><span class="NAME">uninstallMock</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>122</span> </span><span class="WHIT"> </span><span class="NAME">jasmine.Clock.assertInstalled</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>123</span> </span><span class="WHIT"> </span><span class="NAME">jasmine.Clock.installed</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">jasmine.Clock.real</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>124</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'>125</span>
|
||||
<span class='line'>126</span> </span><span class="WHIT"> </span><span class="NAME">real</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>127</span> </span><span class="WHIT"> </span><span class="NAME">setTimeout</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">window.setTimeout</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'>128</span> </span><span class="WHIT"> </span><span class="NAME">clearTimeout</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">window.clearTimeout</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'>129</span> </span><span class="WHIT"> </span><span class="NAME">setInterval</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">window.setInterval</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'>130</span> </span><span class="WHIT"> </span><span class="NAME">clearInterval</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">window.clearInterval</span><span class="WHIT">
|
||||
<span class='line'>131</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
|
||||
<span class='line'>132</span>
|
||||
<span class='line'>133</span> </span><span class="WHIT"> </span><span class="NAME">assertInstalled</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>134</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">jasmine.Clock.installed</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="NAME">jasmine.Clock.defaultFakeTimer</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>135</span> </span><span class="WHIT"> </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Error</span><span class="PUNC">(</span><span class="STRN">"Mock clock is not installed, use jasmine.Clock.useMock()"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>136</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'>137</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="WHIT">
|
||||
<span class='line'>138</span>
|
||||
<span class='line'>139</span> </span><span class="WHIT"> </span><span class="NAME">installed</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT">
|
||||
<span class='line'>140</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>141</span> </span><span class="NAME">jasmine.Clock.installed</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">jasmine.Clock.real</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>142</span>
|
||||
<span class='line'>143</span> </span><span class="NAME">window.setTimeout</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">funcToCall</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">millis</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>144</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">jasmine.Clock.installed.setTimeout.apply</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">arguments</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>145</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>146</span>
|
||||
<span class='line'>147</span> </span><span class="NAME">window.setInterval</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">funcToCall</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">millis</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>148</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">jasmine.Clock.installed.setInterval.apply</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">arguments</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>149</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>150</span>
|
||||
<span class='line'>151</span> </span><span class="NAME">window.clearTimeout</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">timeoutKey</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>152</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">jasmine.Clock.installed.clearTimeout.apply</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">arguments</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>153</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>154</span>
|
||||
<span class='line'>155</span> </span><span class="NAME">window.clearInterval</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">timeoutKey</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'>156</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">jasmine.Clock.installed.clearInterval.apply</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">arguments</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>157</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'>158</span>
|
||||
<span class='line'>159</span> </span></pre></body></html>
|
|
@ -1,67 +0,0 @@
|
|||
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
|
||||
.KEYW {color: #933;}
|
||||
.COMM {color: #bbb; font-style: italic;}
|
||||
.NUMB {color: #393;}
|
||||
.STRN {color: #393;}
|
||||
.REGX {color: #339;}
|
||||
.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
|
||||
</style></head><body><pre><span class='line'> 1</span> <span class="COMM">/**
|
||||
<span class='line'> 2</span> * @namespace
|
||||
<span class='line'> 3</span> */</span><span class="WHIT">
|
||||
<span class='line'> 4</span> </span><span class="NAME">jasmine.util</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 5</span>
|
||||
<span class='line'> 6</span> </span><span class="COMM">/**
|
||||
<span class='line'> 7</span> * Declare that a child class inherite it's prototype from the parent class.
|
||||
<span class='line'> 8</span> *
|
||||
<span class='line'> 9</span> * @private
|
||||
<span class='line'> 10</span> * @param {Function} childClass
|
||||
<span class='line'> 11</span> * @param {Function} parentClass
|
||||
<span class='line'> 12</span> */</span><span class="WHIT">
|
||||
<span class='line'> 13</span> </span><span class="NAME">jasmine.util.inherit</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">childClass</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">parentClass</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 14</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">subclass</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 15</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 16</span> </span><span class="WHIT"> </span><span class="NAME">subclass.prototype</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">parentClass.prototype</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 17</span> </span><span class="WHIT"> </span><span class="NAME">childClass.prototype</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">subclass</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 18</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 19</span>
|
||||
<span class='line'> 20</span> </span><span class="NAME">jasmine.util.formatException</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 21</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">lineNumber</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 22</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">e.line</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 23</span> </span><span class="WHIT"> </span><span class="NAME">lineNumber</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">e.line</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 24</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 25</span> </span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">e.lineNumber</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 26</span> </span><span class="WHIT"> </span><span class="NAME">lineNumber</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">e.lineNumber</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 27</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 28</span>
|
||||
<span class='line'> 29</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">file</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 30</span>
|
||||
<span class='line'> 31</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">e.sourceURL</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 32</span> </span><span class="WHIT"> </span><span class="NAME">file</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">e.sourceURL</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 33</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 34</span> </span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">e.fileName</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 35</span> </span><span class="WHIT"> </span><span class="NAME">file</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">e.fileName</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 36</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 37</span>
|
||||
<span class='line'> 38</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">message</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">e.name</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">e.message</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">e.name</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">': '</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">e.message</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">e.toString</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 39</span>
|
||||
<span class='line'> 40</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">file</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">lineNumber</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 41</span> </span><span class="WHIT"> </span><span class="NAME">message</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">' in '</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">file</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">' (line '</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">lineNumber</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">')'</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 42</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
|
||||
<span class='line'> 43</span>
|
||||
<span class='line'> 44</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">message</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 45</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 46</span>
|
||||
<span class='line'> 47</span> </span><span class="NAME">jasmine.util.htmlEscape</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">str</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 48</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">str</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">str</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 49</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">str.replace</span><span class="PUNC">(</span><span class="REGX">/&/g</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'&'</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'> 50</span> </span><span class="WHIT"> </span><span class="PUNC">.</span><span class="NAME">replace</span><span class="PUNC">(</span><span class="REGX">/</g</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'<'</span><span class="PUNC">)</span><span class="WHIT">
|
||||
<span class='line'> 51</span> </span><span class="WHIT"> </span><span class="PUNC">.</span><span class="NAME">replace</span><span class="PUNC">(</span><span class="REGX">/>/g</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'>'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 52</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 53</span>
|
||||
<span class='line'> 54</span> </span><span class="NAME">jasmine.util.argsToArray</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">args</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
|
||||
<span class='line'> 55</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">arrayOfArgs</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 56</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC"><</span><span class="WHIT"> </span><span class="NAME">args.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">arrayOfArgs.push</span><span class="PUNC">(</span><span class="NAME">args</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 57</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">arrayOfArgs</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 58</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
|
||||
<span class='line'> 59</span>
|
||||
<span class='line'> 60</span> </span></pre></body></html>
|
316
lib/jasmine.js
316
lib/jasmine.js
|
@ -1144,164 +1144,164 @@ jasmine.Matchers.Any.prototype.toString = function() {
|
|||
return '<jasmine.any(' + this.expectedClass + ')>';
|
||||
};
|
||||
|
||||
// Mock setTimeout, clearTimeout
|
||||
// Contributed by Pivotal Computer Systems, www.pivotalsf.com
|
||||
|
||||
jasmine.FakeTimer = function() {
|
||||
this.reset();
|
||||
|
||||
var self = this;
|
||||
self.setTimeout = function(funcToCall, millis) {
|
||||
self.timeoutsMade++;
|
||||
self.scheduleFunction(self.timeoutsMade, funcToCall, millis, false);
|
||||
return self.timeoutsMade;
|
||||
};
|
||||
|
||||
self.setInterval = function(funcToCall, millis) {
|
||||
self.timeoutsMade++;
|
||||
self.scheduleFunction(self.timeoutsMade, funcToCall, millis, true);
|
||||
return self.timeoutsMade;
|
||||
};
|
||||
|
||||
self.clearTimeout = function(timeoutKey) {
|
||||
self.scheduledFunctions[timeoutKey] = undefined;
|
||||
};
|
||||
|
||||
self.clearInterval = function(timeoutKey) {
|
||||
self.scheduledFunctions[timeoutKey] = undefined;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
jasmine.FakeTimer.prototype.reset = function() {
|
||||
this.timeoutsMade = 0;
|
||||
this.scheduledFunctions = {};
|
||||
this.nowMillis = 0;
|
||||
};
|
||||
|
||||
jasmine.FakeTimer.prototype.tick = function(millis) {
|
||||
var oldMillis = this.nowMillis;
|
||||
var newMillis = oldMillis + millis;
|
||||
this.runFunctionsWithinRange(oldMillis, newMillis);
|
||||
this.nowMillis = newMillis;
|
||||
};
|
||||
|
||||
jasmine.FakeTimer.prototype.runFunctionsWithinRange = function(oldMillis, nowMillis) {
|
||||
var scheduledFunc;
|
||||
var funcsToRun = [];
|
||||
for (var timeoutKey in this.scheduledFunctions) {
|
||||
scheduledFunc = this.scheduledFunctions[timeoutKey];
|
||||
if (scheduledFunc != undefined &&
|
||||
scheduledFunc.runAtMillis >= oldMillis &&
|
||||
scheduledFunc.runAtMillis <= nowMillis) {
|
||||
funcsToRun.push(scheduledFunc);
|
||||
this.scheduledFunctions[timeoutKey] = undefined;
|
||||
}
|
||||
}
|
||||
|
||||
if (funcsToRun.length > 0) {
|
||||
funcsToRun.sort(function(a, b) {
|
||||
return a.runAtMillis - b.runAtMillis;
|
||||
});
|
||||
for (var i = 0; i < funcsToRun.length; ++i) {
|
||||
try {
|
||||
var funcToRun = funcsToRun[i];
|
||||
this.nowMillis = funcToRun.runAtMillis;
|
||||
funcToRun.funcToCall();
|
||||
if (funcToRun.recurring) {
|
||||
this.scheduleFunction(funcToRun.timeoutKey,
|
||||
funcToRun.funcToCall,
|
||||
funcToRun.millis,
|
||||
true);
|
||||
}
|
||||
} catch(e) {
|
||||
}
|
||||
}
|
||||
this.runFunctionsWithinRange(oldMillis, nowMillis);
|
||||
}
|
||||
};
|
||||
|
||||
jasmine.FakeTimer.prototype.scheduleFunction = function(timeoutKey, funcToCall, millis, recurring) {
|
||||
this.scheduledFunctions[timeoutKey] = {
|
||||
runAtMillis: this.nowMillis + millis,
|
||||
funcToCall: funcToCall,
|
||||
recurring: recurring,
|
||||
timeoutKey: timeoutKey,
|
||||
millis: millis
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
jasmine.Clock = {
|
||||
defaultFakeTimer: new jasmine.FakeTimer(),
|
||||
|
||||
reset: function() {
|
||||
jasmine.Clock.assertInstalled();
|
||||
jasmine.Clock.defaultFakeTimer.reset();
|
||||
},
|
||||
|
||||
tick: function(millis) {
|
||||
jasmine.Clock.assertInstalled();
|
||||
jasmine.Clock.defaultFakeTimer.tick(millis);
|
||||
},
|
||||
|
||||
runFunctionsWithinRange: function(oldMillis, nowMillis) {
|
||||
jasmine.Clock.defaultFakeTimer.runFunctionsWithinRange(oldMillis, nowMillis);
|
||||
},
|
||||
|
||||
scheduleFunction: function(timeoutKey, funcToCall, millis, recurring) {
|
||||
jasmine.Clock.defaultFakeTimer.scheduleFunction(timeoutKey, funcToCall, millis, recurring);
|
||||
},
|
||||
|
||||
useMock: function() {
|
||||
var spec = jasmine.getEnv().currentSpec;
|
||||
spec.after(jasmine.Clock.uninstallMock);
|
||||
|
||||
jasmine.Clock.installMock();
|
||||
},
|
||||
|
||||
installMock: function() {
|
||||
jasmine.Clock.installed = jasmine.Clock.defaultFakeTimer;
|
||||
},
|
||||
|
||||
uninstallMock: function() {
|
||||
jasmine.Clock.assertInstalled();
|
||||
jasmine.Clock.installed = jasmine.Clock.real;
|
||||
},
|
||||
|
||||
real: {
|
||||
setTimeout: window.setTimeout,
|
||||
clearTimeout: window.clearTimeout,
|
||||
setInterval: window.setInterval,
|
||||
clearInterval: window.clearInterval
|
||||
},
|
||||
|
||||
assertInstalled: function() {
|
||||
if (jasmine.Clock.installed != jasmine.Clock.defaultFakeTimer) {
|
||||
throw new Error("Mock clock is not installed, use jasmine.Clock.useMock()");
|
||||
}
|
||||
},
|
||||
|
||||
installed: null
|
||||
};
|
||||
jasmine.Clock.installed = jasmine.Clock.real;
|
||||
|
||||
window.setTimeout = function(funcToCall, millis) {
|
||||
return jasmine.Clock.installed.setTimeout.apply(this, arguments);
|
||||
};
|
||||
|
||||
window.setInterval = function(funcToCall, millis) {
|
||||
return jasmine.Clock.installed.setInterval.apply(this, arguments);
|
||||
};
|
||||
|
||||
window.clearTimeout = function(timeoutKey) {
|
||||
return jasmine.Clock.installed.clearTimeout.apply(this, arguments);
|
||||
};
|
||||
|
||||
window.clearInterval = function(timeoutKey) {
|
||||
return jasmine.Clock.installed.clearInterval.apply(this, arguments);
|
||||
};
|
||||
|
||||
// Mock setTimeout, clearTimeout
|
||||
// Contributed by Pivotal Computer Systems, www.pivotalsf.com
|
||||
|
||||
jasmine.FakeTimer = function() {
|
||||
this.reset();
|
||||
|
||||
var self = this;
|
||||
self.setTimeout = function(funcToCall, millis) {
|
||||
self.timeoutsMade++;
|
||||
self.scheduleFunction(self.timeoutsMade, funcToCall, millis, false);
|
||||
return self.timeoutsMade;
|
||||
};
|
||||
|
||||
self.setInterval = function(funcToCall, millis) {
|
||||
self.timeoutsMade++;
|
||||
self.scheduleFunction(self.timeoutsMade, funcToCall, millis, true);
|
||||
return self.timeoutsMade;
|
||||
};
|
||||
|
||||
self.clearTimeout = function(timeoutKey) {
|
||||
self.scheduledFunctions[timeoutKey] = undefined;
|
||||
};
|
||||
|
||||
self.clearInterval = function(timeoutKey) {
|
||||
self.scheduledFunctions[timeoutKey] = undefined;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
jasmine.FakeTimer.prototype.reset = function() {
|
||||
this.timeoutsMade = 0;
|
||||
this.scheduledFunctions = {};
|
||||
this.nowMillis = 0;
|
||||
};
|
||||
|
||||
jasmine.FakeTimer.prototype.tick = function(millis) {
|
||||
var oldMillis = this.nowMillis;
|
||||
var newMillis = oldMillis + millis;
|
||||
this.runFunctionsWithinRange(oldMillis, newMillis);
|
||||
this.nowMillis = newMillis;
|
||||
};
|
||||
|
||||
jasmine.FakeTimer.prototype.runFunctionsWithinRange = function(oldMillis, nowMillis) {
|
||||
var scheduledFunc;
|
||||
var funcsToRun = [];
|
||||
for (var timeoutKey in this.scheduledFunctions) {
|
||||
scheduledFunc = this.scheduledFunctions[timeoutKey];
|
||||
if (scheduledFunc != undefined &&
|
||||
scheduledFunc.runAtMillis >= oldMillis &&
|
||||
scheduledFunc.runAtMillis <= nowMillis) {
|
||||
funcsToRun.push(scheduledFunc);
|
||||
this.scheduledFunctions[timeoutKey] = undefined;
|
||||
}
|
||||
}
|
||||
|
||||
if (funcsToRun.length > 0) {
|
||||
funcsToRun.sort(function(a, b) {
|
||||
return a.runAtMillis - b.runAtMillis;
|
||||
});
|
||||
for (var i = 0; i < funcsToRun.length; ++i) {
|
||||
try {
|
||||
var funcToRun = funcsToRun[i];
|
||||
this.nowMillis = funcToRun.runAtMillis;
|
||||
funcToRun.funcToCall();
|
||||
if (funcToRun.recurring) {
|
||||
this.scheduleFunction(funcToRun.timeoutKey,
|
||||
funcToRun.funcToCall,
|
||||
funcToRun.millis,
|
||||
true);
|
||||
}
|
||||
} catch(e) {
|
||||
}
|
||||
}
|
||||
this.runFunctionsWithinRange(oldMillis, nowMillis);
|
||||
}
|
||||
};
|
||||
|
||||
jasmine.FakeTimer.prototype.scheduleFunction = function(timeoutKey, funcToCall, millis, recurring) {
|
||||
this.scheduledFunctions[timeoutKey] = {
|
||||
runAtMillis: this.nowMillis + millis,
|
||||
funcToCall: funcToCall,
|
||||
recurring: recurring,
|
||||
timeoutKey: timeoutKey,
|
||||
millis: millis
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
jasmine.Clock = {
|
||||
defaultFakeTimer: new jasmine.FakeTimer(),
|
||||
|
||||
reset: function() {
|
||||
jasmine.Clock.assertInstalled();
|
||||
jasmine.Clock.defaultFakeTimer.reset();
|
||||
},
|
||||
|
||||
tick: function(millis) {
|
||||
jasmine.Clock.assertInstalled();
|
||||
jasmine.Clock.defaultFakeTimer.tick(millis);
|
||||
},
|
||||
|
||||
runFunctionsWithinRange: function(oldMillis, nowMillis) {
|
||||
jasmine.Clock.defaultFakeTimer.runFunctionsWithinRange(oldMillis, nowMillis);
|
||||
},
|
||||
|
||||
scheduleFunction: function(timeoutKey, funcToCall, millis, recurring) {
|
||||
jasmine.Clock.defaultFakeTimer.scheduleFunction(timeoutKey, funcToCall, millis, recurring);
|
||||
},
|
||||
|
||||
useMock: function() {
|
||||
var spec = jasmine.getEnv().currentSpec;
|
||||
spec.after(jasmine.Clock.uninstallMock);
|
||||
|
||||
jasmine.Clock.installMock();
|
||||
},
|
||||
|
||||
installMock: function() {
|
||||
jasmine.Clock.installed = jasmine.Clock.defaultFakeTimer;
|
||||
},
|
||||
|
||||
uninstallMock: function() {
|
||||
jasmine.Clock.assertInstalled();
|
||||
jasmine.Clock.installed = jasmine.Clock.real;
|
||||
},
|
||||
|
||||
real: {
|
||||
setTimeout: window.setTimeout,
|
||||
clearTimeout: window.clearTimeout,
|
||||
setInterval: window.setInterval,
|
||||
clearInterval: window.clearInterval
|
||||
},
|
||||
|
||||
assertInstalled: function() {
|
||||
if (jasmine.Clock.installed != jasmine.Clock.defaultFakeTimer) {
|
||||
throw new Error("Mock clock is not installed, use jasmine.Clock.useMock()");
|
||||
}
|
||||
},
|
||||
|
||||
installed: null
|
||||
};
|
||||
jasmine.Clock.installed = jasmine.Clock.real;
|
||||
|
||||
window.setTimeout = function(funcToCall, millis) {
|
||||
return jasmine.Clock.installed.setTimeout.apply(this, arguments);
|
||||
};
|
||||
|
||||
window.setInterval = function(funcToCall, millis) {
|
||||
return jasmine.Clock.installed.setInterval.apply(this, arguments);
|
||||
};
|
||||
|
||||
window.clearTimeout = function(timeoutKey) {
|
||||
return jasmine.Clock.installed.clearTimeout.apply(this, arguments);
|
||||
};
|
||||
|
||||
window.clearInterval = function(timeoutKey) {
|
||||
return jasmine.Clock.installed.clearInterval.apply(this, arguments);
|
||||
};
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue