added tests for mockclock

This commit is contained in:
pivotal 2009-10-27 16:49:23 -07:00
parent fa2d36c5dc
commit 6a467fc00e
19 changed files with 2270 additions and 1236 deletions

View File

@ -194,6 +194,8 @@ ul.inheritsList
<li><a href="symbols/jasmine.JsApiReporter.html">jasmine.JsApiReporter</a></li> <li><a href="symbols/jasmine.JsApiReporter.html">jasmine.JsApiReporter</a></li>
<li><a href="symbols/jasmine.Matchers.html">jasmine.Matchers</a></li>
<li><a href="symbols/jasmine.MultiReporter.html">jasmine.MultiReporter</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.NestedResults.html">jasmine.NestedResults</a></li>
@ -258,7 +260,7 @@ ul.inheritsList
</div> </div>
<div class="fineprint" style="clear:both"> <div class="fineprint" style="clear:both">
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blankt">JsDoc Toolkit</a> 2.1.0 on Tue Oct 27 2009 13:32:51 GMT-0700 (PDT) Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blankt">JsDoc Toolkit</a> 2.1.0 on Tue Oct 27 2009 16:48:57 GMT-0700 (PDT)
</div> </div>
</body> </body>
</html> </html>

View File

@ -194,6 +194,8 @@ ul.inheritsList
<li><a href="symbols/jasmine.JsApiReporter.html">jasmine.JsApiReporter</a></li> <li><a href="symbols/jasmine.JsApiReporter.html">jasmine.JsApiReporter</a></li>
<li><a href="symbols/jasmine.Matchers.html">jasmine.Matchers</a></li>
<li><a href="symbols/jasmine.MultiReporter.html">jasmine.MultiReporter</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.NestedResults.html">jasmine.NestedResults</a></li>
@ -248,6 +250,12 @@ ul.inheritsList
</div> </div>
<hr /> <hr />
<div>
<h2><a href="symbols/jasmine.Matchers.html">jasmine.Matchers</a></h2>
</div>
<hr />
<div> <div>
<h2><a href="symbols/jasmine.MultiReporter.html">jasmine.MultiReporter</a></h2> <h2><a href="symbols/jasmine.MultiReporter.html">jasmine.MultiReporter</a></h2>
@ -300,7 +308,7 @@ ul.inheritsList
</div> </div>
<div class="fineprint" style="clear:both"> <div class="fineprint" style="clear:both">
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blankt">JsDoc Toolkit</a> 2.1.0 on Tue Oct 27 2009 13:32:51 GMT-0700 (PDT) Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blankt">JsDoc Toolkit</a> 2.1.0 on Tue Oct 27 2009 16:48:57 GMT-0700 (PDT)
</div> </div>
</body> </body>
</html> </html>

View File

@ -199,6 +199,8 @@ ul.inheritsList
<li><a href="../symbols/jasmine.JsApiReporter.html">jasmine.JsApiReporter</a></li> <li><a href="../symbols/jasmine.JsApiReporter.html">jasmine.JsApiReporter</a></li>
<li><a href="../symbols/jasmine.Matchers.html">jasmine.Matchers</a></li>
<li><a href="../symbols/jasmine.MultiReporter.html">jasmine.MultiReporter</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.NestedResults.html">jasmine.NestedResults</a></li>
@ -908,7 +910,7 @@ A convenience method that allows existing specs to be disabled temporarily durin
<!-- ============================== footer ================================= --> <!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both"> <div class="fineprint" style="clear:both">
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Tue Oct 27 2009 13:32:51 GMT-0700 (PDT) Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Tue Oct 27 2009 16:48:57 GMT-0700 (PDT)
</div> </div>
</body> </body>
</html> </html>

View File

@ -199,6 +199,8 @@ ul.inheritsList
<li><a href="../symbols/jasmine.JsApiReporter.html">jasmine.JsApiReporter</a></li> <li><a href="../symbols/jasmine.JsApiReporter.html">jasmine.JsApiReporter</a></li>
<li><a href="../symbols/jasmine.Matchers.html">jasmine.Matchers</a></li>
<li><a href="../symbols/jasmine.MultiReporter.html">jasmine.MultiReporter</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.NestedResults.html">jasmine.NestedResults</a></li>
@ -339,7 +341,7 @@ ul.inheritsList
<!-- ============================== footer ================================= --> <!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both"> <div class="fineprint" style="clear:both">
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Tue Oct 27 2009 13:32:51 GMT-0700 (PDT) Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Tue Oct 27 2009 16:48:57 GMT-0700 (PDT)
</div> </div>
</body> </body>
</html> </html>

View File

@ -199,6 +199,8 @@ ul.inheritsList
<li><a href="../symbols/jasmine.JsApiReporter.html">jasmine.JsApiReporter</a></li> <li><a href="../symbols/jasmine.JsApiReporter.html">jasmine.JsApiReporter</a></li>
<li><a href="../symbols/jasmine.Matchers.html">jasmine.Matchers</a></li>
<li><a href="../symbols/jasmine.MultiReporter.html">jasmine.MultiReporter</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.NestedResults.html">jasmine.NestedResults</a></li>
@ -507,7 +509,7 @@ ul.inheritsList
<!-- ============================== footer ================================= --> <!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both"> <div class="fineprint" style="clear:both">
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Tue Oct 27 2009 13:32:51 GMT-0700 (PDT) Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Tue Oct 27 2009 16:48:57 GMT-0700 (PDT)
</div> </div>
</body> </body>
</html> </html>

View File

@ -199,6 +199,8 @@ ul.inheritsList
<li><a href="../symbols/jasmine.JsApiReporter.html">jasmine.JsApiReporter</a></li> <li><a href="../symbols/jasmine.JsApiReporter.html">jasmine.JsApiReporter</a></li>
<li><a href="../symbols/jasmine.Matchers.html">jasmine.Matchers</a></li>
<li><a href="../symbols/jasmine.MultiReporter.html">jasmine.MultiReporter</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.NestedResults.html">jasmine.NestedResults</a></li>
@ -316,7 +318,7 @@ ul.inheritsList
<!-- ============================== footer ================================= --> <!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both"> <div class="fineprint" style="clear:both">
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Tue Oct 27 2009 13:32:51 GMT-0700 (PDT) Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Tue Oct 27 2009 16:48:57 GMT-0700 (PDT)
</div> </div>
</body> </body>
</html> </html>

File diff suppressed because it is too large Load Diff

View File

@ -199,6 +199,8 @@ ul.inheritsList
<li><a href="../symbols/jasmine.JsApiReporter.html">jasmine.JsApiReporter</a></li> <li><a href="../symbols/jasmine.JsApiReporter.html">jasmine.JsApiReporter</a></li>
<li><a href="../symbols/jasmine.Matchers.html">jasmine.Matchers</a></li>
<li><a href="../symbols/jasmine.MultiReporter.html">jasmine.MultiReporter</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.NestedResults.html">jasmine.NestedResults</a></li>
@ -316,7 +318,7 @@ ul.inheritsList
<!-- ============================== footer ================================= --> <!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both"> <div class="fineprint" style="clear:both">
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Tue Oct 27 2009 13:32:51 GMT-0700 (PDT) Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Tue Oct 27 2009 16:48:57 GMT-0700 (PDT)
</div> </div>
</body> </body>
</html> </html>

View File

@ -199,6 +199,8 @@ ul.inheritsList
<li><a href="../symbols/jasmine.JsApiReporter.html">jasmine.JsApiReporter</a></li> <li><a href="../symbols/jasmine.JsApiReporter.html">jasmine.JsApiReporter</a></li>
<li><a href="../symbols/jasmine.Matchers.html">jasmine.Matchers</a></li>
<li><a href="../symbols/jasmine.MultiReporter.html">jasmine.MultiReporter</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.NestedResults.html">jasmine.NestedResults</a></li>
@ -700,7 +702,7 @@ ul.inheritsList
<!-- ============================== footer ================================= --> <!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both"> <div class="fineprint" style="clear:both">
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Tue Oct 27 2009 13:32:51 GMT-0700 (PDT) Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Tue Oct 27 2009 16:48:57 GMT-0700 (PDT)
</div> </div>
</body> </body>
</html> </html>

View File

@ -199,6 +199,8 @@ ul.inheritsList
<li><a href="../symbols/jasmine.JsApiReporter.html">jasmine.JsApiReporter</a></li> <li><a href="../symbols/jasmine.JsApiReporter.html">jasmine.JsApiReporter</a></li>
<li><a href="../symbols/jasmine.Matchers.html">jasmine.Matchers</a></li>
<li><a href="../symbols/jasmine.MultiReporter.html">jasmine.MultiReporter</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.NestedResults.html">jasmine.NestedResults</a></li>
@ -316,7 +318,7 @@ ul.inheritsList
<!-- ============================== footer ================================= --> <!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both"> <div class="fineprint" style="clear:both">
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Tue Oct 27 2009 13:32:51 GMT-0700 (PDT) Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Tue Oct 27 2009 16:48:57 GMT-0700 (PDT)
</div> </div>
</body> </body>
</html> </html>

View File

@ -199,6 +199,8 @@ ul.inheritsList
<li><a href="../symbols/jasmine.JsApiReporter.html">jasmine.JsApiReporter</a></li> <li><a href="../symbols/jasmine.JsApiReporter.html">jasmine.JsApiReporter</a></li>
<li><a href="../symbols/jasmine.Matchers.html">jasmine.Matchers</a></li>
<li><a href="../symbols/jasmine.MultiReporter.html">jasmine.MultiReporter</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.NestedResults.html">jasmine.NestedResults</a></li>
@ -327,7 +329,7 @@ ul.inheritsList
<!-- ============================== footer ================================= --> <!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both"> <div class="fineprint" style="clear:both">
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Tue Oct 27 2009 13:32:51 GMT-0700 (PDT) Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Tue Oct 27 2009 16:48:57 GMT-0700 (PDT)
</div> </div>
</body> </body>
</html> </html>

View File

@ -199,6 +199,8 @@ ul.inheritsList
<li><a href="../symbols/jasmine.JsApiReporter.html">jasmine.JsApiReporter</a></li> <li><a href="../symbols/jasmine.JsApiReporter.html">jasmine.JsApiReporter</a></li>
<li><a href="../symbols/jasmine.Matchers.html">jasmine.Matchers</a></li>
<li><a href="../symbols/jasmine.MultiReporter.html">jasmine.MultiReporter</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.NestedResults.html">jasmine.NestedResults</a></li>
@ -339,7 +341,7 @@ ul.inheritsList
<!-- ============================== footer ================================= --> <!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both"> <div class="fineprint" style="clear:both">
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Tue Oct 27 2009 13:32:51 GMT-0700 (PDT) Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Tue Oct 27 2009 16:48:57 GMT-0700 (PDT)
</div> </div>
</body> </body>
</html> </html>

View File

@ -199,6 +199,8 @@ ul.inheritsList
<li><a href="../symbols/jasmine.JsApiReporter.html">jasmine.JsApiReporter</a></li> <li><a href="../symbols/jasmine.JsApiReporter.html">jasmine.JsApiReporter</a></li>
<li><a href="../symbols/jasmine.Matchers.html">jasmine.Matchers</a></li>
<li><a href="../symbols/jasmine.MultiReporter.html">jasmine.MultiReporter</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.NestedResults.html">jasmine.NestedResults</a></li>
@ -845,7 +847,7 @@ expect(foo.bar.callCount).toEqual(0);</pre>
<!-- ============================== footer ================================= --> <!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both"> <div class="fineprint" style="clear:both">
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Tue Oct 27 2009 13:32:51 GMT-0700 (PDT) Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Tue Oct 27 2009 16:48:57 GMT-0700 (PDT)
</div> </div>
</body> </body>
</html> </html>

View File

@ -199,6 +199,8 @@ ul.inheritsList
<li><a href="../symbols/jasmine.JsApiReporter.html">jasmine.JsApiReporter</a></li> <li><a href="../symbols/jasmine.JsApiReporter.html">jasmine.JsApiReporter</a></li>
<li><a href="../symbols/jasmine.Matchers.html">jasmine.Matchers</a></li>
<li><a href="../symbols/jasmine.MultiReporter.html">jasmine.MultiReporter</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.NestedResults.html">jasmine.NestedResults</a></li>
@ -345,7 +347,7 @@ ul.inheritsList
<!-- ============================== footer ================================= --> <!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both"> <div class="fineprint" style="clear:both">
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Tue Oct 27 2009 13:32:51 GMT-0700 (PDT) Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Tue Oct 27 2009 16:48:57 GMT-0700 (PDT)
</div> </div>
</body> </body>
</html> </html>

View File

@ -199,6 +199,8 @@ ul.inheritsList
<li><a href="../symbols/jasmine.JsApiReporter.html">jasmine.JsApiReporter</a></li> <li><a href="../symbols/jasmine.JsApiReporter.html">jasmine.JsApiReporter</a></li>
<li><a href="../symbols/jasmine.Matchers.html">jasmine.Matchers</a></li>
<li><a href="../symbols/jasmine.MultiReporter.html">jasmine.MultiReporter</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.NestedResults.html">jasmine.NestedResults</a></li>
@ -353,15 +355,6 @@ Jasmine environment.</div>
</td> </td>
</tr> </tr>
<tr>
<td class="attributes">&lt;static&gt; &nbsp;</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> <tr>
<td class="attributes">&lt;static&gt; &nbsp;</td> <td class="attributes">&lt;static&gt; &nbsp;</td>
<td class="nameDescription"> <td class="nameDescription">
@ -655,54 +648,6 @@ Jasmine environment.
<hr />
<a name=".Matchers"> </a>
<div class="fixedFont">&lt;static&gt;
<span class="light">jasmine.</span><b>Matchers</b>(env,, actual, results)
</div>
<div class="description">
</div>
<dl class="detailList">
<dt class="heading">Parameters:</dt>
<dt>
<b>env,</b>
</dt>
<dd>actual, results</dd>
<dt>
<b>actual</b>
</dt>
<dd></dd>
<dt>
<b>results</b>
</dt>
<dd></dd>
</dl>
<hr /> <hr />
<a name=".pp"> </a> <a name=".pp"> </a>
@ -785,7 +730,7 @@ Jasmine environment.
<!-- ============================== footer ================================= --> <!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both"> <div class="fineprint" style="clear:both">
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Tue Oct 27 2009 13:32:51 GMT-0700 (PDT) Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Tue Oct 27 2009 16:48:57 GMT-0700 (PDT)
</div> </div>
</body> </body>
</html> </html>

View File

@ -199,6 +199,8 @@ ul.inheritsList
<li><a href="../symbols/jasmine.JsApiReporter.html">jasmine.JsApiReporter</a></li> <li><a href="../symbols/jasmine.JsApiReporter.html">jasmine.JsApiReporter</a></li>
<li><a href="../symbols/jasmine.Matchers.html">jasmine.Matchers</a></li>
<li><a href="../symbols/jasmine.MultiReporter.html">jasmine.MultiReporter</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.NestedResults.html">jasmine.NestedResults</a></li>
@ -316,7 +318,7 @@ ul.inheritsList
<!-- ============================== footer ================================= --> <!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both"> <div class="fineprint" style="clear:both">
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Tue Oct 27 2009 13:32:51 GMT-0700 (PDT) Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Tue Oct 27 2009 16:48:57 GMT-0700 (PDT)
</div> </div>
</body> </body>
</html> </html>

File diff suppressed because it is too large Load Diff

View File

@ -530,7 +530,7 @@ jasmine.version_= {
"major": 0, "major": 0,
"minor": 10, "minor": 10,
"build": 0, "build": 0,
"revision": 1256675572 "revision": 1256687337
}; };
/** /**
* @namespace * @namespace

View File

@ -0,0 +1,34 @@
describe("MockClock", function () {
beforeEach(function() {
jasmine.Clock.useMock();
});
describe("setTimeout", function () {
it("should mock the clock when useMock is in a beforeEach", function() {
var expected = false;
setTimeout(function() {
expected = true;
}, 30000);
expect(expected).toBe(false);
jasmine.Clock.tick(30001);
expect(expected).toBe(true);
});
});
describe("setInterval", function () {
it("should mock the clock when useMock is in a beforeEach", function() {
var interval = 0;
setInterval(function() {
interval++;
}, 30000);
expect(interval).toEqual(0);
jasmine.Clock.tick(30001);
expect(interval).toEqual(1);
jasmine.Clock.tick(30001);
expect(interval).toEqual(2);
jasmine.Clock.tick(1);
expect(interval).toEqual(2);
});
});
});