Skip to content

Commit

Permalink
notPropEqual: added documentation
Browse files Browse the repository at this point in the history
Partially fix qunitjs#14
  • Loading branch information
leobalter committed Jan 18, 2014
1 parent 781e6b7 commit 071ba20
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions entries/notPropEqual.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="../entries2html.xsl" ?>
<entry type="method" name="notPropEqual">
<title>notPropEqual()</title>
<signature>
<argument name="actual" type="Object">
<desc>Object being tested</desc>
</argument>
<argument name="expected" type="Object">
<desc>Known comparison value</desc>
</argument>
<argument name="message" type="String">
<desc>A short description of the assertion</desc>
</argument>
</signature>
<desc>
A strict comparison of an object own properties assertion, checking for inequality.
</desc>
<longdesc>
<p>The <code>notPropEqual</code> assertion uses the strict inverted comparison operator (<code>!==</code>) to compare the actual and expected arguments as Objects regarding only their properties but not their constructors.</p>
<p>When they aren't equal, the assertion passes; otherwise, it fails. When it fails, both actual and expected values are displayed in the test result, in addition to a given message.</p>
<p><a href="/equal"><code>equal()</code></a> can be used to test equality.</p>
<p><a href="/propEqual"><code>propEqual()</code></a> can be used to test strict equality of an Object properties.</p>
</longdesc>
<example>
<desc>Compare the values of two objects properties.</desc>
<code><![CDATA[
test( "notPropEqual test", function() {
function Foo( x, y, z ) {
this.x = x;
this.y = y;
this.z = z;
}
Foo.prototype.doA = function () {};
Foo.prototype.doB = function () {};
Foo.prototype.bar = 'prototype';
var foo = new Foo( 1, "2", [] );
var bar = new Foo( "1", 2, {} );
notPropEqual( foo, bar, "Properties values are strictly compared." );
});
]]></code>
</example>
<category slug="assert"/>
</entry>

0 comments on commit 071ba20

Please sign in to comment.