ok
This commit is contained in:
parent
9064e35f3f
commit
4c531b5ae7
371 changed files with 338 additions and 316 deletions
|
@ -0,0 +1,37 @@
|
|||
describe("Accumulator(1)", function() {
|
||||
var accumulator;
|
||||
before(function() {
|
||||
accumulator = new Accumulator(1);
|
||||
});
|
||||
|
||||
beforeEach(function() {
|
||||
sinon.stub(window, "prompt")
|
||||
});
|
||||
|
||||
afterEach(function() {
|
||||
prompt.restore();
|
||||
});
|
||||
|
||||
it("начальное значение 1", function() {
|
||||
assert.equal(accumulator.value, 1);
|
||||
});
|
||||
|
||||
it("после ввода 0 значение 1", function() {
|
||||
prompt.returns("0");
|
||||
accumulator.read();
|
||||
assert.equal(accumulator.value, 1);
|
||||
});
|
||||
|
||||
it("после ввода 1 значение 2", function() {
|
||||
prompt.returns("1");
|
||||
accumulator.read();
|
||||
assert.equal(accumulator.value, 2);
|
||||
});
|
||||
|
||||
it("после ввода 2 значение 4", function() {
|
||||
prompt.returns("2");
|
||||
accumulator.read();
|
||||
assert.equal(accumulator.value, 4);
|
||||
});
|
||||
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue