This commit is contained in:
Ilya Kantor 2017-02-19 01:41:36 +03:00
parent d7d25f4d8b
commit 20784e7f26
48 changed files with 302 additions and 397 deletions

View file

@ -1,25 +1,25 @@
sinon.stub(window, "prompt")
prompt.onCall(0).returns("2");
prompt.onCall(1).returns("3");
describe("calculator", function() {
var calculator;
let calculator;
before(function() {
sinon.stub(window, "prompt")
prompt.onCall(0).returns("2");
prompt.onCall(1).returns("3");
calculator = new Calculator();
calculator.read();
});
it("при вводе 2 и 3 сумма равна 5", function() {
it("when 2 and 3 are entered, the sum is 5", function() {
assert.equal(calculator.sum(), 5);
});
it("при вводе 2 и 3 произведение равно 6", function() {
it("when 2 and 3 are entered, the product is 6", function() {
assert.equal(calculator.mul(), 6);
});
after(function() {
prompt.restore();
});
});
after(function() {
prompt.restore();
});