Skip to content

Instantly share code, notes, and snippets.

@colmarius
Created March 5, 2015 12:42
Show Gist options
  • Save colmarius/8f36d7a069849d39c332 to your computer and use it in GitHub Desktop.
Save colmarius/8f36d7a069849d39c332 to your computer and use it in GitHub Desktop.
Stack kata steps
# newly created stacks should be empty
# after one push stack size should be one
# after one push and one pop should be empty
# when pushed past limit stack overflows
# when empty stack popped should throw underflow
# when one is pushed one is popped
# when one and two are pushed two and one are popped
# when creating stack with negative size should throw illegal capacity
# when creating stack with zero capacity any push should overflow
# when one is pushed one is on top
# when stack is empty top throws empty
# with zero capacity stack top throws empty
# given stack with 1, 2 pushed find 1 and 2
# given stack with no 2, find should return nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment