diff options
author | Ariel Flesler <aflesler@gmail.com> | 2008-05-12 22:59:58 +0000 |
---|---|---|
committer | Ariel Flesler <aflesler@gmail.com> | 2008-05-12 22:59:58 +0000 |
commit | 37394598cb96ed17319b7f5f7e8e70ac0ee6633d (patch) | |
tree | 4769eecef17a213e577b4638c828047ce8c75eb0 | |
parent | 16f6b3684d259c245c79a459195224a370234b82 (diff) | |
download | jquery-37394598cb96ed17319b7f5f7e8e70ac0ee6633d.tar.gz jquery-37394598cb96ed17319b7f5f7e8e70ac0ee6633d.zip |
test runner: improved a test and added a missing semicolon
-rw-r--r-- | test/unit/core.js | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/test/unit/core.js b/test/unit/core.js index fccf8e459..b33a6eae2 100644 --- a/test/unit/core.js +++ b/test/unit/core.js @@ -374,13 +374,15 @@ test("attr(Hash)", function() { test("attr(String, Object)", function() {
expect(17);
- var div = $("div");
- div.attr("foo", "bar");
- var pass = true;
+ var div = $("div").attr("foo", "bar");
+ fail = false;
for ( var i = 0; i < div.size(); i++ ) {
- if ( div.get(i).getAttribute('foo') != "bar" ) pass = false;
+ if ( div.get(i).getAttribute('foo') != "bar" ){
+ fail = i;
+ break;
+ }
}
- ok( pass, "Set Attribute" );
+ equals( fail, false, "Set Attribute, the #"+fail+" element didn't get the attribute 'foo'" );
ok( $("#foo").attr({"width": null}), "Try to set an attribute to nothing" );
@@ -412,7 +414,7 @@ test("attr(String, Object)", function() { j.attr("name", "attrvalue");
equals( j.attr("name"), "attrvalue", "Check node,textnode,comment for attr" );
- j.removeAttr("name")
+ j.removeAttr("name");
reset();
|