up
This commit is contained in:
parent
5372c18379
commit
3defacc09d
314 changed files with 1761 additions and 1704 deletions
|
@ -0,0 +1,28 @@
|
|||
|
||||
|
||||
describe("calculator", function() {
|
||||
|
||||
context("when 2 and 3 entered", function() {
|
||||
beforeEach(function() {
|
||||
sinon.stub(window, "prompt");
|
||||
|
||||
prompt.onCall(0).returns("2");
|
||||
prompt.onCall(1).returns("3");
|
||||
|
||||
calculator.read();
|
||||
});
|
||||
|
||||
afterEach(function() {
|
||||
prompt.restore();
|
||||
});
|
||||
|
||||
it("the sum is 5", function() {
|
||||
assert.equal(calculator.sum(), 5);
|
||||
});
|
||||
|
||||
it("the multiplication product is 6", function() {
|
||||
assert.equal(calculator.mul(), 6);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue