Created
September 13, 2012 19:42
-
-
Save jredville/3717061 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe Stack do | |
Invariants do | |
If { stack.empty? } | |
Then { stack.depth.should == 0 } | |
Then { stack.should be_pushable } | |
ElseIf { stack.full? } | |
Then { stack.depth.should == stack.max_depth } | |
Then { stack.should_not be_pushable } | |
Else | |
Then { stack.depth.should be > 0 } # not wild about this part | |
# Alternative | |
When { stack.empty? } | |
# thens | |
When { stack.full? } | |
# thens | |
Otherwise | |
Then { stack.depth.should be > 0 } #not wild about this part | |
# more thens | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment