Skip to content

Commit

Permalink
expose issue with single elimination brackets depth
Browse files Browse the repository at this point in the history
  • Loading branch information
spaghetticode committed Jul 8, 2014
1 parent 203d0ab commit 0865cf5
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion spec/bracket_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
bracket.matches.should be_a Array
bracket.matches.map(&:class).should == [BracketTree::Match, BracketTree::Match, BracketTree::Match]
end

it 'should create an empty if matches are not passed' do
bracket.matches.should be_a Array
bracket.matches.should == []
Expand Down Expand Up @@ -196,4 +196,14 @@
end
end
end

describe 'single elimination bracket' do
let(:klass) {BracketTree::Bracket::SingleElimination }

it 'builds brackets with expected depth' do
[[64, 7], [128,8]].each do |size, depth|
klass.by_size(size).depth.should == {:left => depth, :right => depth, :total => depth}
end
end
end
end

0 comments on commit 0865cf5

Please sign in to comment.