git.asbjorn.biz
/
jquery.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
16f6b36
)
test runner: improved a test and added a missing semicolon
author
Ariel Flesler
<aflesler@gmail.com>
Mon, 12 May 2008 22:59:58 +0000
(22:59 +0000)
committer
Ariel Flesler
<aflesler@gmail.com>
Mon, 12 May 2008 22:59:58 +0000
(22:59 +0000)
test/unit/core.js
patch
|
blob
|
history
diff --git
a/test/unit/core.js
b/test/unit/core.js
index
fccf8e4
..
b33a6ea
100644
(file)
--- a/
test/unit/core.js
+++ b/
test/unit/core.js
@@
-374,13
+374,15
@@
test("attr(Hash)", function() {
\r
test("attr(String, Object)", function() {
\r
expect(17);
\r
\r
test("attr(String, Object)", function() {
\r
expect(17);
\r
- var div = $("div");
\r
- div.attr("foo", "bar");
\r
- var pass = true;
\r
+ var div = $("div").attr("foo", "bar");
\r
+ fail = false;
\r
for ( var i = 0; i < div.size(); i++ ) {
\r
for ( var i = 0; i < div.size(); i++ ) {
\r
- if ( div.get(i).getAttribute('foo') != "bar" ) pass = false;
\r
+ if ( div.get(i).getAttribute('foo') != "bar" ){
\r
+ fail = i;
\r
+ break;
\r
+ }
\r
}
\r
}
\r
- ok( pass, "Set Attribute" );
\r
+ equals( fail, false, "Set Attribute, the #"+fail+" element didn't get the attribute 'foo'" );
\r
\r
ok( $("#foo").attr({"width": null}), "Try to set an attribute to nothing" );
\r
\r
\r
ok( $("#foo").attr({"width": null}), "Try to set an attribute to nothing" );
\r
\r
@@
-412,7
+414,7
@@
test("attr(String, Object)", function() {
\r
j.attr("name", "attrvalue");
\r
equals( j.attr("name"), "attrvalue", "Check node,textnode,comment for attr" );
\r
\r
j.attr("name", "attrvalue");
\r
equals( j.attr("name"), "attrvalue", "Check node,textnode,comment for attr" );
\r
- j.removeAttr("name")
\r
+ j.removeAttr("name");
\r
\r
reset();
\r
\r
\r
reset();
\r
\r