Skip to content

Commit

Permalink
Minor doc fix
Browse files Browse the repository at this point in the history
  • Loading branch information
pivotalops committed Oct 27, 2009
1 parent a0cac54 commit fa2d36c
Show file tree
Hide file tree
Showing 18 changed files with 2,346 additions and 2,181 deletions.
2 changes: 1 addition & 1 deletion doc/files.html
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ <h2><a href="symbols/src/lib_TrivialReporter.js.html">lib/TrivialReporter.js</a>
</div>
<div class="fineprint" style="clear:both">

Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blankt">JsDoc Toolkit</a> 2.1.0 on Sat Oct 24 2009 17:00:43 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 13:32:51 GMT-0700 (PDT)
</div>
</body>
</html>
2 changes: 1 addition & 1 deletion doc/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ <h2><a href="symbols/jasmine.util.html">jasmine.util</a></h2>
</div>
<div class="fineprint" style="clear:both">

Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blankt">JsDoc Toolkit</a> 2.1.0 on Sat Oct 24 2009 17:00:43 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 13:32:51 GMT-0700 (PDT)
</div>
</body>
</html>
43 changes: 33 additions & 10 deletions doc/symbols/_global_.html
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,9 @@ <h1 class="classTitle">

</div>
<div class="description">
A function that is called after each spec in a suite.Used for restoring any state that is hijacked during spec execution.
A function that is called after each spec in a suite.

Used for restoring any state that is hijacked during spec execution.

<br />
<i>Defined in: </i> <a href="../symbols/src/lib_jasmine-0.10.0.js.html">jasmine-0.10.0.js</a>.
Expand Down Expand Up @@ -423,7 +425,9 @@ <h1 class="classTitle">

</div>
<div class="description">
A function that is called before each spec in a suite.Used for spec setup, including validating assumptions.
A function that is called before each spec in a suite.

Used for spec setup, including validating assumptions.

<br />
<i>Defined in: </i> <a href="../symbols/src/lib_jasmine-0.10.0.js.html">jasmine-0.10.0.js</a>.
Expand Down Expand Up @@ -462,7 +466,11 @@ <h1 class="classTitle">

</div>
<div class="description">
Defines a suite of specifications.Stores the description and all defined specs in the Jasmine environment as one suite of specs. Variables declaredare accessible by calls to beforeEach, it, and afterEach. Describe blocks can be nested, allowing for specializationof setup in some tests.
Defines a suite of specifications.

Stores the description and all defined specs in the Jasmine environment as one suite of specs. Variables declared
are accessible by calls to beforeEach, it, and afterEach. Describe blocks can be nested, allowing for specialization
of setup in some tests.

<br />
<i>Defined in: </i> <a href="../symbols/src/lib_jasmine-0.10.0.js.html">jasmine-0.10.0.js</a>.
Expand All @@ -472,7 +480,9 @@ <h1 class="classTitle">



<pre class="code">// TODO: a simple suite// TODO: a simple suite with a nested describe block</pre>
<pre class="code">// TODO: a simple suite

// TODO: a simple suite with a nested describe block</pre>



Expand Down Expand Up @@ -511,7 +521,10 @@ <h1 class="classTitle">

</div>
<div class="description">
Starts a chain for a Jasmine expectation.It is passed an Object that is the actual value and should chain to one of the manyjasmine.Matchers functions.
Starts a chain for a Jasmine expectation.

It is passed an Object that is the actual value and should chain to one of the many
jasmine.Matchers functions.

<br />
<i>Defined in: </i> <a href="../symbols/src/lib_jasmine-0.10.0.js.html">jasmine-0.10.0.js</a>.
Expand Down Expand Up @@ -550,7 +563,9 @@ <h1 class="classTitle">

</div>
<div class="description">
Creates a Jasmine spec that will be added to the current suite.// TODO: pending tests
Creates a Jasmine spec that will be added to the current suite.

// TODO: pending tests

<br />
<i>Defined in: </i> <a href="../symbols/src/lib_jasmine-0.10.0.js.html">jasmine-0.10.0.js</a>.
Expand All @@ -560,7 +575,9 @@ <h1 class="classTitle">



<pre class="code">it('should be true', function() { expect(true).toEqual(true);});</pre>
<pre class="code">it('should be true', function() {
expect(true).toEqual(true);
});</pre>



Expand Down Expand Up @@ -648,7 +665,11 @@ <h1 class="classTitle">



<pre class="code">// spy examplevar foo = { not: function(bool) { return !bool; }}spyOn(foo, 'not'); // actual foo.not will not be called, execution stops</pre>
<pre class="code">// spy example
var foo = {
not: function(bool) { return !bool; }
}
spyOn(foo, 'not'); // actual foo.not will not be called, execution stops</pre>



Expand Down Expand Up @@ -836,7 +857,9 @@ <h1 class="classTitle">

</div>
<div class="description">
Creates a <em>disabled</em> Jasmine spec.A convenience method that allows existing specs to be disabled temporarily during development.
Creates a <em>disabled</em> Jasmine spec.

A convenience method that allows existing specs to be disabled temporarily during development.

<br />
<i>Defined in: </i> <a href="../symbols/src/lib_jasmine-0.10.0.js.html">jasmine-0.10.0.js</a>.
Expand Down Expand Up @@ -885,7 +908,7 @@ <h1 class="classTitle">
<!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both">

Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Sat Oct 24 2009 17:00:43 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 13:32:51 GMT-0700 (PDT)
</div>
</body>
</html>
2 changes: 1 addition & 1 deletion doc/symbols/jasmine.Block.html
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ <h1 class="classTitle">
<!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both">

Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Sat Oct 24 2009 17:00:43 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 13:32:51 GMT-0700 (PDT)
</div>
</body>
</html>
2 changes: 1 addition & 1 deletion doc/symbols/jasmine.Env.html
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ <h1 class="classTitle">
<!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both">

Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Sat Oct 24 2009 17:00:43 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 13:32:51 GMT-0700 (PDT)
</div>
</body>
</html>
2 changes: 1 addition & 1 deletion doc/symbols/jasmine.JsApiReporter.html
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ <h1 class="classTitle">
<!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both">

Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Sat Oct 24 2009 17:00:43 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 13:32:51 GMT-0700 (PDT)
</div>
</body>
</html>
2 changes: 1 addition & 1 deletion doc/symbols/jasmine.MultiReporter.html
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ <h1 class="classTitle">
<!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both">

Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Sat Oct 24 2009 17:00:43 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 13:32:51 GMT-0700 (PDT)
</div>
</body>
</html>
2 changes: 1 addition & 1 deletion doc/symbols/jasmine.NestedResults.html
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,7 @@ <h1 class="classTitle">
<!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both">

Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Sat Oct 24 2009 17:00:43 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 13:32:51 GMT-0700 (PDT)
</div>
</body>
</html>
2 changes: 1 addition & 1 deletion doc/symbols/jasmine.Reporter.html
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ <h1 class="classTitle">
<!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both">

Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Sat Oct 24 2009 17:00:43 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 13:32:51 GMT-0700 (PDT)
</div>
</body>
</html>
2 changes: 1 addition & 1 deletion doc/symbols/jasmine.Runner.html
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ <h1 class="classTitle">
<!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both">

Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Sat Oct 24 2009 17:00:43 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 13:32:51 GMT-0700 (PDT)
</div>
</body>
</html>
2 changes: 1 addition & 1 deletion doc/symbols/jasmine.Spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ <h1 class="classTitle">
<!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both">

Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Sat Oct 24 2009 17:00:43 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 13:32:51 GMT-0700 (PDT)
</div>
</body>
</html>
90 changes: 78 additions & 12 deletions doc/symbols/jasmine.Spy.html
Original file line number Diff line number Diff line change
Expand Up @@ -412,15 +412,46 @@ <h1 class="classTitle">
</div>

<div class="description">
Jasmine Spies are test doubles that can act as stubs, spies, fakes or when used in an expecation, mocks.Spies should be created in test setup, before expectations. They can then be checked, using the standard Jasmineexpectation syntax. Spies can be checked if they were called or not and what the calling params were.A Spy has the following mehtod: wasCalled, callCount, mostRecentCall, and argsForCall (see docs)Spies are torn down at the end of every spec.Note: Do <b>not</b> call new jasmine.Spy() directly - a spy must be created using spyOn, jasmine.createSpy or jasmine.createSpyObj.
Jasmine Spies are test doubles that can act as stubs, spies, fakes or when used in an expecation, mocks.

Spies should be created in test setup, before expectations. They can then be checked, using the standard Jasmine
expectation syntax. Spies can be checked if they were called or not and what the calling params were.

A Spy has the following mehtod: wasCalled, callCount, mostRecentCall, and argsForCall (see docs)
Spies are torn down at the end of every spec.

Note: Do <b>not</b> call new jasmine.Spy() directly - a spy must be created using spyOn, jasmine.createSpy or jasmine.createSpyObj.

</div>



<pre class="code">// a stubvar myStub = jasmine.createSpy('myStub'); // can be used anywhere// spy examplevar foo = { not: function(bool) { return !bool; }}// actual foo.not will not be called, execution stopsspyOn(foo, 'not');

// foo.not spied upon, execution will continue to implementationspyOn(foo, 'not').andCallThrough();// fake examplevar foo = { not: function(bool) { return !bool; }}// foo.not(val) will return valspyOn(foo, 'not').andCallFake(function(value) {return value;});// mock examplefoo.not(7 == 7);expect(foo.not).wasCalled();expect(foo.not).wasCalledWith(true);</pre>
<pre class="code">// a stub
var myStub = jasmine.createSpy('myStub'); // can be used anywhere

// spy example
var foo = {
not: function(bool) { return !bool; }
}

// actual foo.not will not be called, execution stops
spyOn(foo, 'not');

// foo.not spied upon, execution will continue to implementation
spyOn(foo, 'not').andCallThrough();

// fake example
var foo = {
not: function(bool) { return !bool; }
}

// foo.not(val) will return val
spyOn(foo, 'not').andCallFake(function(value) {return value;});

// mock example
foo.not(7 == 7);
expect(foo.not).wasCalled();
expect(foo.not).wasCalledWith(true);</pre>



Expand Down Expand Up @@ -475,7 +506,12 @@ <h1 class="classTitle">



<pre class="code">var mySpy = jasmine.createSpy('foo');mySpy(1, 2);mySpy(7, 8);mySpy.mostRecentCall.args = [7, 8];mySpy.argsForCall[0] = [1, 2];mySpy.argsForCall[1] = [7, 8];</pre>
<pre class="code">var mySpy = jasmine.createSpy('foo');
mySpy(1, 2);
mySpy(7, 8);
mySpy.mostRecentCall.args = [7, 8];
mySpy.argsForCall[0] = [1, 2];
mySpy.argsForCall[1] = [7, 8];</pre>



Expand Down Expand Up @@ -545,7 +581,9 @@ <h1 class="classTitle">



<pre class="code">var mySpy = jasmine.createSpy('foo');mySpy(1, 2);mySpy.mostRecentCall.args = [1, 2];</pre>
<pre class="code">var mySpy = jasmine.createSpy('foo');
mySpy(1, 2);
mySpy.mostRecentCall.args = [1, 2];</pre>



Expand Down Expand Up @@ -579,7 +617,14 @@ <h1 class="classTitle">



<pre class="code">var baz = function() { // do some stuff, return something}// defining a spy from scratch: foo() calls the function bazvar foo = jasmine.createSpy('spy on foo').andCall(baz);// defining a spy on an existing property: foo.bar() calls an anonymnous functionspyOn(foo, 'bar').andCall(function() { return 'baz';} );</pre>
<pre class="code">var baz = function() {
// do some stuff, return something
}
// defining a spy from scratch: foo() calls the function baz
var foo = jasmine.createSpy('spy on foo').andCall(baz);

// defining a spy on an existing property: foo.bar() calls an anonymnous function
spyOn(foo, 'bar').andCall(function() { return 'baz';} );</pre>



Expand Down Expand Up @@ -619,7 +664,12 @@ <h1 class="classTitle">



<pre class="code">var foo = { bar: function() { // do some stuff }}// defining a spy on an existing property: foo.barspyOn(foo, 'bar').andCallThrough();</pre>
<pre class="code">var foo = {
bar: function() { // do some stuff }
}

// defining a spy on an existing property: foo.bar
spyOn(foo, 'bar').andCallThrough();</pre>



Expand Down Expand Up @@ -648,7 +698,11 @@ <h1 class="classTitle">



<pre class="code">// defining a spy from scratch: foo() returns 'baz'var foo = jasmine.createSpy('spy on foo').andReturn('baz');// defining a spy on an existing property: foo.bar() returns 'baz'spyOn(foo, 'bar').andReturn('baz');</pre>
<pre class="code">// defining a spy from scratch: foo() returns 'baz'
var foo = jasmine.createSpy('spy on foo').andReturn('baz');

// defining a spy on an existing property: foo.bar() returns 'baz'
spyOn(foo, 'bar').andReturn('baz');</pre>



Expand Down Expand Up @@ -688,7 +742,11 @@ <h1 class="classTitle">



<pre class="code">// defining a spy from scratch: foo() throws an exception w/ message 'ouch'var foo = jasmine.createSpy('spy on foo').andThrow('baz');// defining a spy on an existing property: foo.bar() throws an exception w/ message 'ouch'spyOn(foo, 'bar').andThrow('baz');</pre>
<pre class="code">// defining a spy from scratch: foo() throws an exception w/ message 'ouch'
var foo = jasmine.createSpy('spy on foo').andThrow('baz');

// defining a spy on an existing property: foo.bar() throws an exception w/ message 'ouch'
spyOn(foo, 'bar').andThrow('baz');</pre>



Expand Down Expand Up @@ -753,7 +811,15 @@ <h1 class="classTitle">



<pre class="code">spyOn(foo, 'bar');foo.bar();expect(foo.bar.callCount).toEqual(1);foo.bar.reset();expect(foo.bar.callCount).toEqual(0);</pre>
<pre class="code">spyOn(foo, 'bar');

foo.bar();

expect(foo.bar.callCount).toEqual(1);

foo.bar.reset();

expect(foo.bar.callCount).toEqual(0);</pre>



Expand All @@ -779,7 +845,7 @@ <h1 class="classTitle">
<!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both">

Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Sat Oct 24 2009 17:00:43 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 13:32:51 GMT-0700 (PDT)
</div>
</body>
</html>
2 changes: 1 addition & 1 deletion doc/symbols/jasmine.Suite.html
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ <h1 class="classTitle">
<!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both">

Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Sat Oct 24 2009 17:00:43 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 13:32:51 GMT-0700 (PDT)
</div>
</body>
</html>
Loading

0 comments on commit fa2d36c

Please sign in to comment.