"A Stack" should "pop values in last-in-first-out order" in { val stack = newStack[Int] stack.push(1) stack.push(2) stack.pop() should be (2) stack.pop() should be (1) }
it should "throw NoSuchElementException if an empty stack is popped" in { val emptyStack = newStack[Int] a [NoSuchElementException] should be thrownBy { emptyStack.pop() } } }