test passing with repeater.count

This commit is contained in:
Andres Ornelas 2010-08-04 11:47:10 -07:00
parent ec12285c9d
commit 26ed747588
2 changed files with 8 additions and 3 deletions

View file

@ -10,11 +10,12 @@ Matcher.addMatcher = function(name, matcher) {
$scenario.addFuture(
'expect ' + future.name + ' ' + name + ' ' + expected,
function(done){
if (matcher(future.value, expected))
if (!matcher(future.value, expected))
throw "Expected " + expected + ' but was ' + future.value;
done();
}
);
dump('future added');
};
};

View file

@ -46,8 +46,12 @@ describe("DSL", function() {
var future = repeater('.repeater-row').count();
expect(future.name).toEqual("repeater '.repeater-row' count");
executeFuture(future, "<div class='repeater-row'>a</div>" +
"<div class='repeater-row'>b</div>");
Expect(future).toEqual(2);
"<div class='repeater-row'>b</div>",
function(value) {
future.fulfill(value);
});
expect(future.fulfilled).toBeTruthy();
expect(future.value).toEqual(2);
});
});
});