Skip to content
Browse files

added test to the spec showing you can stub individual elements in a …

…selector set
  • Loading branch information...
1 parent ca3cb33 commit ed3d168641882026644b8151a6f9abf1671ec096 unknown committed Jul 29, 2010
Showing with 14 additions and 0 deletions.
  1. +14 −0 spec/spec.html
View
14 spec/spec.html
@@ -47,6 +47,20 @@
equals(actual, 'bar');
});
+
+ test("will allow adding multiple elements into the selector stub", function() {
+ $.stubs.addForSelector("div.foo", function(stub) {
+ stub[0] = "0";
+ stub[1] = "1";
+ stub.length = 2;
+ });
+
+ var actual = $('div.foo');
+
+ equals(actual[0], "0");
+ equals(actual[1], "1");
+ equals(actual.length, 2);
+ });
module("the $.stubs.addForFunction method", lifecycle);

0 comments on commit ed3d168

Please sign in to comment.
Something went wrong with that request. Please try again.