Permalink
Browse files

update documentation

  • Loading branch information...
1 parent d1e339a commit 61cf31fc701c805182ab457c57cb5b64ad413f04 Chris Lundquist committed with mk Oct 10, 2012
Showing with 6 additions and 10 deletions.
  1. +1 −1 lib/saulabs/trueskill/factor_graph.rb
  2. +5 −9 spec/saulabs/trueskill/factor_graph_spec.rb
@@ -60,7 +60,7 @@ class FactorGraph
# team2 = [Rating.new(22.0, 0.98, 0.8), Rating.new(31.1, 5.33, 0.9)]
#
# # team 1 finished first and team 2 second
- # graph = FactorGraph.new([team1, team2], [1,2])
+ # graph = FactorGraph.new( team1 => 1, team2 => 2 )
#
# # update the Ratings
# graph.update_skills
@@ -1,7 +1,7 @@
# -*- encoding : utf-8 -*-
require File.expand_path('spec/spec_helper.rb')
-describe Saulabs::TrueSkill::FactorGraph do
+describe Saulabs::TrueSkill::FactorGraph, "Unit Tests" do
before :each do
@teams = create_teams
@@ -11,7 +11,6 @@
end
describe "#update_skills" do
-
it "should update the mean of the first player in team1 to 30.38345" do
@graph.update_skills
@skill.mean.should be_within(tolerance).of(30.38345)
@@ -21,24 +20,22 @@
@graph.update_skills
@skill.deviation.should be_within(tolerance).of(3.46421)
end
-
end
describe "#draw_margin" do
-
it "should be -0.998291 for diff 0.740466" do
@graph.draw_margin.should be_within(tolerance).of(0.740466)
end
-
end
+end
-
+describe Saulabs::TrueSkill::FactorGraph, "Integration Tests" do
context "When there are two teams" do
- let :team1 do
+ let :team1 do # Each team needs unique instances as we modify by side effect
[TrueSkill::Rating.new(25.0, 25.0/3.0, 1.0, 25.0/300.0)]
end
- let :team2 do
+ let :team2 do # Each team needs unique instances as we modify by side effect
[TrueSkill::Rating.new(25.0, 25.0/3.0, 1.0, 25.0/300.0)]
end
@@ -107,7 +104,6 @@
end
-
context "when it is a 1 vs 2" do
let :team2 do
[

0 comments on commit 61cf31f

Please sign in to comment.