describe('the stack spec', () => {
  it('shows the infrastructure works', () => {
    true.should.be.true();
  });

  const makeStack = () => {
    let size = 0;

    return {
      pop: () => size--,
      push: () => size++,
      isEmpty: () => size === 0,
      size: () => size
    };
  };

  let stack;

  describe('a stack should', () => {
    beforeEach(() => {
      stack = makeStack();
    });

    it('start empty', () => {
      stack.isEmpty().should.be.true();
    });

    it('start with stack size 0', () => {
      stack.size().should.equal(0);
    });

    it('not be empty when pushed', () => {
      stack.push();
      stack.isEmpty().should.be.false();
    });

    it('leave stack size 1 when pushed', () => {
      stack.push();
      stack.size().should.equal(1);
    });

    it('leave stack empty when pushed and popped', () => {
      stack.push();
      stack.pop();
      stack.isEmpty().should.be.true();
    });

    it('leave stack size 0 when pushed and popped', () => {
      stack.push();
      stack.pop();
      stack.size().should.equal(0);
    });

    it('overflow', () => {
      stack.push();
      stack.push();

      (() => {
        stack.push();
      }).should.throw('Error: overflow.');
    });

    it('underflow');

    it('pop the same one pushed');

    it('pop the same two pushed');

    it('accept only positive capacity');
  });
}
);

@@ -130,16 +130,28 @@
 tack = (
+capacity = 2
 ) =%3E %7B%0A 
@@ -206,16 +206,17 @@
 size--,%0A
+%0A
       pu
@@ -229,15 +229,92 @@
  =%3E 
-size++,
+%7B%0A        if (size === capacity) throw new Error('hello');%0A        size++;%0A      %7D,%0A
 %0A   

change message to AssertionError: expected Function { name: '' } to throw exception with a message matching 'Error: overflow.', but got 'hello'