mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-05-08 23:04:45 +00:00
test passing with repeater.count
This commit is contained in:
parent
ec12285c9d
commit
26ed747588
2 changed files with 8 additions and 3 deletions
|
|
@ -10,11 +10,12 @@ Matcher.addMatcher = function(name, matcher) {
|
||||||
$scenario.addFuture(
|
$scenario.addFuture(
|
||||||
'expect ' + future.name + ' ' + name + ' ' + expected,
|
'expect ' + future.name + ' ' + name + ' ' + expected,
|
||||||
function(done){
|
function(done){
|
||||||
if (matcher(future.value, expected))
|
if (!matcher(future.value, expected))
|
||||||
throw "Expected " + expected + ' but was ' + future.value;
|
throw "Expected " + expected + ' but was ' + future.value;
|
||||||
done();
|
done();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
dump('future added');
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -46,8 +46,12 @@ describe("DSL", function() {
|
||||||
var future = repeater('.repeater-row').count();
|
var future = repeater('.repeater-row').count();
|
||||||
expect(future.name).toEqual("repeater '.repeater-row' count");
|
expect(future.name).toEqual("repeater '.repeater-row' count");
|
||||||
executeFuture(future, "<div class='repeater-row'>a</div>" +
|
executeFuture(future, "<div class='repeater-row'>a</div>" +
|
||||||
"<div class='repeater-row'>b</div>");
|
"<div class='repeater-row'>b</div>",
|
||||||
Expect(future).toEqual(2);
|
function(value) {
|
||||||
|
future.fulfill(value);
|
||||||
|
});
|
||||||
|
expect(future.fulfilled).toBeTruthy();
|
||||||
|
expect(future.value).toEqual(2);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue