Skip to content

Commit

Permalink
Исправил тесты для Fireball::act, добавив проверку вызова метода Leve…
Browse files Browse the repository at this point in the history
…l::obstacleAt
  • Loading branch information
dfitiskin committed Jun 2, 2017
1 parent 7e59faa commit dd6d42b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/fireball.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,24 +104,30 @@ describe('Класс Fireball', () => {

it('Вызывает level.obstacleAt со своим вектором размера', () => {
const ball = new Fireball(position, speed);
let isCalled = false;
const level = {
obstacleAt(pos, size) {
expect(size).to.eql(new Vector(1, 1));
isCalled = true;
}
};

ball.act(time, level);
expect(isCalled).to.be.true;
});

it('Вызывает level.obstacleAt с вектором новой позиции', () => {
const ball = new Fireball(position, speed);
let isCalled = false;
const level = {
obstacleAt(pos, size) {
expect(pos).to.eql(new Vector(10, 5));
isCalled = true;
}
};

ball.act(time, level);
expect(isCalled).to.be.true;
});
});
});

0 comments on commit dd6d42b

Please sign in to comment.