Add specs for Cylon#stop

This commit is contained in:
Andrew Stewart 2014-03-09 19:18:45 -07:00
parent a112a5bedc
commit cbbaa10c52
1 changed files with 18 additions and 0 deletions

View File

@ -267,4 +267,22 @@ describe("Cylon", function() {
expect(bot2.start).to.be.called;
});
});
describe("#stop", function() {
before(function() {
cylon.robots = [];
});
it("calls #stop() on all robots", function() {
var bot1 = { stop: spy() },
bot2 = { stop: spy() };
cylon.robots = [bot1, bot2];
cylon.stop();
expect(bot1.stop).to.be.called;
expect(bot2.stop).to.be.called;
});
});
});