Skip to content

Commit

Permalink
actual unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
John Lindal committed May 15, 2012
1 parent cfd2fee commit a8052c7
Showing 1 changed file with 33 additions and 1 deletion.
34 changes: 33 additions & 1 deletion src/oop/tests/oop-test.js
Expand Up @@ -76,11 +76,43 @@ suite.add(new Y.Test.Case({
// should not throw // should not throw
}); });


Y.each([1], function(v, k) {
count++;
});

Y.each({ foo: 1 }, function(v, k) { Y.each({ foo: 1 }, function(v, k) {
count++; count++;
}); });


Assert.areEqual(1, count); Assert.areEqual(2, count);
},

test_some: function () {
var count = 0;

Y.some(null, function(v, k) {
// should not throw
});

Y.some('string', function(v, k) {
// should not throw
});

Y.some(12345, function(v, k) {
// should not throw
});

Y.some([1,2], function(v, k) {
count++;
return v == 1;
});

Y.some({ foo: 1, bar: 2 }, function(v, k) {
count++;
return v == 1;
});

Assert.areEqual(2, count);
}, },


test_extend: function () { test_extend: function () {
Expand Down

0 comments on commit a8052c7

Please sign in to comment.