From 84b475c43132d50d2ec00390e65b6ed3d5d64a56 Mon Sep 17 00:00:00 2001 From: mo khan Date: Sat, 13 Jul 2013 10:46:54 -0600 Subject: extract block visitor to utility --- spec/data_structures/binary_tree_spec.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'spec/data_structures/binary_tree_spec.rb') 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 -- cgit v1.2.3