diff options
Diffstat (limited to 'spec/data_structures/binary_tree_spec.rb')
| -rw-r--r-- | spec/data_structures/binary_tree_spec.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/spec/data_structures/binary_tree_spec.rb b/spec/data_structures/binary_tree_spec.rb index 350ddc4..348be6f 100644 --- a/spec/data_structures/binary_tree_spec.rb +++ b/spec/data_structures/binary_tree_spec.rb @@ -4,27 +4,27 @@ require "spec_helper" #each node has at most two children #nodes with children are parent nodes. describe BinaryTree do - let(:sut) { BinaryTree.new } + subject { BinaryTree.new } context "when there are no items in the tree" do it "should have a size of 0" do - expect(sut.size).to eq(0) + expect(subject.size).to eq(0) end end context "when many items are pushed on to the tree" do before :each do 10.times do |n| - sut.push(rand(n)) + subject.push(rand(n)) end end it "should increase the size" do - expect(sut.size).to eq(10) + expect(subject.size).to eq(10) end it "can iterate through each item" do - sut.each do |item| + subject.each do |item| expect(item).not_to be_nil end end |
