diff options
author | francis <francis> | 2008-01-23 01:54:49 +0000 |
---|---|---|
committer | francis <francis> | 2008-01-23 01:54:49 +0000 |
commit | fdaa98e06ba6d6f8b62480a83e9ecffdbcb21402 (patch) | |
tree | 40b8b0d7602a7a17bead44e0fd3a2ea101b18bd6 /vendor/plugins/rspec/examples/stack.rb | |
parent | 60eaae4f7df1f1dae91defb87d3707451c359cf4 (diff) |
Upgrade to rspec 1.1.2
Diffstat (limited to 'vendor/plugins/rspec/examples/stack.rb')
-rw-r--r-- | vendor/plugins/rspec/examples/stack.rb | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/vendor/plugins/rspec/examples/stack.rb b/vendor/plugins/rspec/examples/stack.rb deleted file mode 100644 index 407173f7b..000000000 --- a/vendor/plugins/rspec/examples/stack.rb +++ /dev/null @@ -1,36 +0,0 @@ -class StackUnderflowError < RuntimeError -end - -class StackOverflowError < RuntimeError -end - -class Stack - - def initialize - @items = [] - end - - def push object - raise StackOverflowError if @items.length == 10 - @items.push object - end - - def pop - raise StackUnderflowError if @items.empty? - @items.delete @items.last - end - - def peek - raise StackUnderflowError if @items.empty? - @items.last - end - - def empty? - @items.empty? - end - - def full? - @items.length == 10 - end - -end |