summaryrefslogtreecommitdiff
path: root/spec/data_structures/binary_tree_spec.rb
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2013-07-13 10:46:54 -0600
committermo khan <mo@mokhan.ca>2013-07-13 10:46:54 -0600
commit84b475c43132d50d2ec00390e65b6ed3d5d64a56 (patch)
tree444f6ebada694a124fd74728c7b908d7b37f27df /spec/data_structures/binary_tree_spec.rb
parent0225329a4502070d8af17df6401af691643f7a45 (diff)
extract block visitor to utility
Diffstat (limited to 'spec/data_structures/binary_tree_spec.rb')
-rw-r--r--spec/data_structures/binary_tree_spec.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/spec/data_structures/binary_tree_spec.rb b/spec/data_structures/binary_tree_spec.rb
index f8fc1c1..d51e8ce 100644
--- a/spec/data_structures/binary_tree_spec.rb
+++ b/spec/data_structures/binary_tree_spec.rb
@@ -13,11 +13,20 @@ describe BinaryTree do
end
context "when many items are pushed on to the tree" do
- it "should increase the size" do
+ before :each do
10.times do |n|
sut.push(n)
end
+ end
+
+ it "should increase the size" do
sut.size.should == 10
end
+
+ it "can iterate through each item" do
+ sut.each do |item|
+ item.should_not be_nil
+ end
+ end
end
end