From 3d11eb7959716e5800f4e7d15b081d532545319f Mon Sep 17 00:00:00 2001
From: Patrick Brinich-Langlois <pbrinichlanglois@gmail.com>
Date: Thu, 9 May 2024 17:28:18 -0700
Subject: [PATCH 1/6] Run Transpec

https://github.com/yujinakayama/transpec
---
 Gemfile                                       |  3 +-
 Gemfile.lock                                  | 32 ++++++---
 spec/saulabs/gauss/distribution_spec.rb       | 66 +++++++++----------
 .../gauss/truncated_correction_spec.rb        | 20 +++---
 spec/saulabs/trueskill/factor_graph_spec.rb   | 22 +++----
 .../trueskill/factors/greater_than_spec.rb    |  4 +-
 .../trueskill/factors/likelihood_spec.rb      |  6 +-
 spec/saulabs/trueskill/factors/prior_spec.rb  |  4 +-
 .../trueskill/factors/weighted_sum_spec.rb    | 38 +++++------
 spec/saulabs/trueskill/factors/within_spec.rb |  4 +-
 .../trueskill/layers/prior_to_skills_spec.rb  | 10 +--
 .../score_based_bayesian_rating_spec.rb       | 30 ++++-----
 12 files changed, 126 insertions(+), 113 deletions(-)

diff --git a/Gemfile b/Gemfile
index 6c0b24e..47a3fbb 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,8 +1,9 @@
 source :gemcutter
 
 gem 'rake'
-gem 'rspec'
+gem 'rspec', '2.99.0'
 gem 'simplecov'
 gem 'yard'
 gem 'yard-rspec'
 gem 'bluecloth'
+gem 'transpec'
diff --git a/Gemfile.lock b/Gemfile.lock
index 1740e99..fdf8183 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -1,22 +1,30 @@
 GEM
   remote: http://rubygems.org/
   specs:
+    ast (2.4.2)
     bluecloth (2.2.0)
-    diff-lcs (1.1.3)
+    diff-lcs (1.5.1)
     multi_json (1.3.6)
+    parser (2.7.2.0)
+      ast (~> 2.4.1)
+    rainbow (1.99.2)
     rake (0.9.2.2)
-    rspec (2.11.0)
-      rspec-core (~> 2.11.0)
-      rspec-expectations (~> 2.11.0)
-      rspec-mocks (~> 2.11.0)
-    rspec-core (2.11.1)
-    rspec-expectations (2.11.2)
-      diff-lcs (~> 1.1.3)
-    rspec-mocks (2.11.2)
+    rspec (2.99.0)
+      rspec-core (~> 2.99.0)
+      rspec-expectations (~> 2.99.0)
+      rspec-mocks (~> 2.99.0)
+    rspec-core (2.99.2)
+    rspec-expectations (2.99.2)
+      diff-lcs (>= 1.1.3, < 2.0)
+    rspec-mocks (2.99.4)
     simplecov (0.6.4)
       multi_json (~> 1.0)
       simplecov-html (~> 0.5.3)
     simplecov-html (0.5.3)
+    transpec (0.2.6)
+      parser (~> 2.0)
+      rainbow (~> 1.1)
+      rspec (~> 2.14)
     yard (0.8.2.1)
     yard-rspec (0.1)
       yard
@@ -27,7 +35,11 @@ PLATFORMS
 DEPENDENCIES
   bluecloth
   rake
-  rspec
+  rspec (= 2.99.0)
   simplecov
+  transpec
   yard
   yard-rspec
+
+BUNDLED WITH
+   2.4.10
diff --git a/spec/saulabs/gauss/distribution_spec.rb b/spec/saulabs/gauss/distribution_spec.rb
index 0006b56..9e340da 100644
--- a/spec/saulabs/gauss/distribution_spec.rb
+++ b/spec/saulabs/gauss/distribution_spec.rb
@@ -4,19 +4,19 @@
 describe Gauss::Distribution, "#initialize" do
 
   it "should set the mean to 10.1" do
-    Gauss::Distribution.new(10.1, 0.4).mean.should == 10.1
+    expect(Gauss::Distribution.new(10.1, 0.4).mean).to eq(10.1)
   end
   
   it "should set the deviation to 0.4" do
-    Gauss::Distribution.new(10.1, 0.4).deviation.should == 0.4
+    expect(Gauss::Distribution.new(10.1, 0.4).deviation).to eq(0.4)
   end
   
   it "should set the mean to 0.0 if the given mean is not finite" do
-    Gauss::Distribution.new(1 / 0.0, 0.4).mean.should == 0.0
+    expect(Gauss::Distribution.new(1 / 0.0, 0.4).mean).to eq(0.0)
   end
   
   it "should set the deviation to 0.0 if the given deviation is not finite" do
-    Gauss::Distribution.new(10.1, 1 / 0.0).deviation.should == 0.0
+    expect(Gauss::Distribution.new(10.1, 1 / 0.0).deviation).to eq(0.0)
   end
   
 end
@@ -28,23 +28,23 @@
   end
 
   it "should have a default mean value of 25.0" do
-    @dist.mean.should == 25.0
+    expect(@dist.mean).to eq(25.0)
   end
 
   it "should have a default deviation of 8.333333" do
-    @dist.deviation.should be_within(0.000001).of(8.333333)
+    expect(@dist.deviation).to be_within(0.000001).of(8.333333)
   end
 
   it "should set the variance to 69.444438" do
-    @dist.variance.should be_within(0.0001).of(69.4444)
+    expect(@dist.variance).to be_within(0.0001).of(69.4444)
   end
 
   it "should set the precision to 0.0144" do
-    @dist.precision.should be_within(0.0001).of(0.0144)
+    expect(@dist.precision).to be_within(0.0001).of(0.0144)
   end
 
   it "should set the precision_mean to 0.36" do
-    @dist.precision_mean.should be_within(0.0001).of(0.36)
+    expect(@dist.precision_mean).to be_within(0.0001).of(0.36)
   end
   
 end
@@ -56,23 +56,23 @@
   end
 
   it "should have a default mean value of 25.0" do
-    @dist.mean.should == 25.0
+    expect(@dist.mean).to eq(25.0)
   end
 
   it "should have a default deviation of 8.333333" do
-    @dist.deviation.should be_within(0.000001).of(8.333333)
+    expect(@dist.deviation).to be_within(0.000001).of(8.333333)
   end
 
   it "should set the variance to 69.444438" do
-    @dist.variance.should be_within(0.0001).of(69.4444)
+    expect(@dist.variance).to be_within(0.0001).of(69.4444)
   end
 
   it "should set the precision to 0.0144" do
-    @dist.precision.should be_within(0.0001).of(0.0144)
+    expect(@dist.precision).to be_within(0.0001).of(0.0144)
   end
 
   it "should set the precision_mean to 0.36" do
-    @dist.precision_mean.should be_within(0.0001).of(0.36)
+    expect(@dist.precision_mean).to be_within(0.0001).of(0.36)
   end
   
 end
@@ -84,15 +84,15 @@
   end
   
   it "should be 0.0 for the same distribution" do
-    (@dist - @dist).should == 0.0
+    expect(@dist - @dist).to eq(0.0)
   end
   
   it "should equal the precision mean if the 0-distribution is subtracted" do
-    (@dist - Gauss::Distribution.new).should == @dist.precision_mean
+    expect(@dist - Gauss::Distribution.new).to eq(@dist.precision_mean)
   end
   
   it "should be 130.399408 for (22, 0.4) - (12, 1.3)" do
-    (Gauss::Distribution.new(22, 0.4) - Gauss::Distribution.new(12, 1.3)).should be_within(tolerance).of(130.399408)
+    expect(Gauss::Distribution.new(22, 0.4) - Gauss::Distribution.new(12, 1.3)).to be_within(tolerance).of(130.399408)
   end
   
 end
@@ -100,7 +100,7 @@
 describe Gauss::Distribution, "#value_at" do
   
   it "should have a value of 0.073654 for x = 2" do
-    Gauss::Distribution.new(4,5).value_at(2).should be_within(tolerance).of(0.073654)
+    expect(Gauss::Distribution.new(4,5).value_at(2)).to be_within(tolerance).of(0.073654)
   end
   
 end
@@ -108,11 +108,11 @@
 describe Gauss::Distribution, "multiplication (*)" do
   
   it "should have a mean of 0.2" do
-    (Gauss::Distribution.new(0,1) * Gauss::Distribution.new(2,3)).mean.should be_within(0.00001).of(0.2)
+    expect((Gauss::Distribution.new(0,1) * Gauss::Distribution.new(2,3)).mean).to be_within(0.00001).of(0.2)
   end
   
   it "should have a deviation of 3.0 / Math.sqrt(10)" do
-    (Gauss::Distribution.new(0,1) * Gauss::Distribution.new(2,3)).deviation.should be_within(0.00001).of(3.0 / Math.sqrt(10))
+    expect((Gauss::Distribution.new(0,1) * Gauss::Distribution.new(2,3)).deviation).to be_within(0.00001).of(3.0 / Math.sqrt(10))
   end
   
 end
@@ -121,7 +121,7 @@
   
   it "should have calculate -3.0979981" do
     lp = Gauss::Distribution.log_product_normalization(Gauss::Distribution.new(4,5), Gauss::Distribution.new(6,7))
-    lp.should be_within(0.000001).of(-3.0979981)
+    expect(lp).to be_within(0.000001).of(-3.0979981)
   end
   
 end
@@ -131,44 +131,44 @@
   describe 'value = 0.27' do
     
     it "#cumulative_distribution_function should return 0.6064198 for 0.27" do
-      Gauss::Distribution.cumulative_distribution_function(0.27).should be_within(0.00001).of(0.6064198)
-      Gauss::Distribution.cdf(2.0).should be_within(0.00001).of(0.9772498)
+      expect(Gauss::Distribution.cumulative_distribution_function(0.27)).to be_within(0.00001).of(0.6064198)
+      expect(Gauss::Distribution.cdf(2.0)).to be_within(0.00001).of(0.9772498)
     end
     
     it "#probability_density_function should return 0.384662" do
-      Gauss::Distribution.probability_density_function(0.27).should be_within(0.0001).of(0.384662)
+      expect(Gauss::Distribution.probability_density_function(0.27)).to be_within(0.0001).of(0.384662)
     end
     
     it "#quantile_function should return ~ -0.6128123 at 0.27" do
-      Gauss::Distribution.quantile_function(0.27).should be_within(0.00001).of(-0.6128123)
+      expect(Gauss::Distribution.quantile_function(0.27)).to be_within(0.00001).of(-0.6128123)
     end
     
     it "#quantile_function should return ~ 1.281551 at 0.9" do
-      Gauss::Distribution.quantile_function(0.9).should be_within(0.00001).of(1.281551)
+      expect(Gauss::Distribution.quantile_function(0.9)).to be_within(0.00001).of(1.281551)
     end
     
     it "#erf_inv should return 0.0888559 at 0.9" do
-      Gauss::Distribution.inv_erf(0.9).should be_within(0.00001).of(0.0888559)
+      expect(Gauss::Distribution.inv_erf(0.9)).to be_within(0.00001).of(0.0888559)
     end
     
     it "#erf_inv should return 0.779983 at 0.27" do
-      Gauss::Distribution.inv_erf(0.27).should be_within(0.00001).of(0.779983)
+      expect(Gauss::Distribution.inv_erf(0.27)).to be_within(0.00001).of(0.779983)
     end
     
     it "#erf_inv should return 100 at -0.5" do
-      Gauss::Distribution.inv_erf(-0.5).should be_within(0.00001).of(100)
+      expect(Gauss::Distribution.inv_erf(-0.5)).to be_within(0.00001).of(100)
     end
     
     it "#erf should return 0.203091 at 0.9" do
-      Gauss::Distribution.erf(0.9).should be_within(0.00001).of(0.203091)
+      expect(Gauss::Distribution.erf(0.9)).to be_within(0.00001).of(0.203091)
     end
     
     it "#erf should return 0.702581 at 0.27" do
-      Gauss::Distribution.erf(0.27).should be_within(0.00001).of(0.702581)
+      expect(Gauss::Distribution.erf(0.27)).to be_within(0.00001).of(0.702581)
     end
     
     it "#erf should return 1.520499 at -0.5" do
-      Gauss::Distribution.erf(-0.5).should be_within(0.00001).of(1.520499)
+      expect(Gauss::Distribution.erf(-0.5)).to be_within(0.00001).of(1.520499)
     end
     
   end
@@ -184,7 +184,7 @@
   
   it "should be equal to the replaced distribution" do
     @dist1.replace(@dist2)
-    @dist1.should == @dist2
+    expect(@dist1).to eq(@dist2)
   end
   
 end
diff --git a/spec/saulabs/gauss/truncated_correction_spec.rb b/spec/saulabs/gauss/truncated_correction_spec.rb
index ae79de5..4cfc4a7 100644
--- a/spec/saulabs/gauss/truncated_correction_spec.rb
+++ b/spec/saulabs/gauss/truncated_correction_spec.rb
@@ -6,8 +6,8 @@
   describe "#w_within_margin" do
 
     it "should return 0.970397 for (0.2, 0.3)" do
-      Gauss::TruncatedCorrection.w_within_margin(0.2, 0.3).should be_within(tolerance).of(0.970397)
-      Gauss::TruncatedCorrection.w_within_margin(0.1, 0.03).should be_within(tolerance).of(0.9997)
+      expect(Gauss::TruncatedCorrection.w_within_margin(0.2, 0.3)).to be_within(tolerance).of(0.970397)
+      expect(Gauss::TruncatedCorrection.w_within_margin(0.1, 0.03)).to be_within(tolerance).of(0.9997)
     end
 
   end
@@ -15,8 +15,8 @@
   describe "#v_within_margin" do
 
     it "should return -0.194073 for (0.2, 0.3)" do
-      Gauss::TruncatedCorrection.v_within_margin(0.2, 0.3).should be_within(tolerance).of(-0.194073)
-      Gauss::TruncatedCorrection.v_within_margin(0.1, 0.03).should be_within(tolerance).of(-0.09997)
+      expect(Gauss::TruncatedCorrection.v_within_margin(0.2, 0.3)).to be_within(tolerance).of(-0.194073)
+      expect(Gauss::TruncatedCorrection.v_within_margin(0.1, 0.03)).to be_within(tolerance).of(-0.09997)
     end
 
   end
@@ -24,9 +24,9 @@
   describe "#w_exceeds_margin" do
   
     it "should return 0.657847 for (0.2, 0.3)" do
-      Gauss::TruncatedCorrection.w_exceeds_margin(0.0, 0.740466).should be_within(tolerance).of(0.76774506)
-      Gauss::TruncatedCorrection.w_exceeds_margin(0.2, 0.3).should be_within(tolerance).of(0.657847)
-      Gauss::TruncatedCorrection.w_exceeds_margin(0.1, 0.03).should be_within(tolerance).of(0.621078)
+      expect(Gauss::TruncatedCorrection.w_exceeds_margin(0.0, 0.740466)).to be_within(tolerance).of(0.76774506)
+      expect(Gauss::TruncatedCorrection.w_exceeds_margin(0.2, 0.3)).to be_within(tolerance).of(0.657847)
+      expect(Gauss::TruncatedCorrection.w_exceeds_margin(0.1, 0.03)).to be_within(tolerance).of(0.621078)
     end
   
   end
@@ -34,9 +34,9 @@
   describe "#v_exceeds_margin" do
   
     it "should return 0.8626174 for (0.2, 0.3)" do
-      Gauss::TruncatedCorrection.v_exceeds_margin(0.0, 0.740466).should be_within(tolerance).of(1.32145197)
-      Gauss::TruncatedCorrection.v_exceeds_margin(0.2, 0.3).should be_within(tolerance).of(0.8626174)
-      Gauss::TruncatedCorrection.v_exceeds_margin(0.1, 0.03).should be_within(tolerance).of(0.753861)
+      expect(Gauss::TruncatedCorrection.v_exceeds_margin(0.0, 0.740466)).to be_within(tolerance).of(1.32145197)
+      expect(Gauss::TruncatedCorrection.v_exceeds_margin(0.2, 0.3)).to be_within(tolerance).of(0.8626174)
+      expect(Gauss::TruncatedCorrection.v_exceeds_margin(0.1, 0.03)).to be_within(tolerance).of(0.753861)
     end
   
   end
diff --git a/spec/saulabs/trueskill/factor_graph_spec.rb b/spec/saulabs/trueskill/factor_graph_spec.rb
index 6d4e7de..3cdbc0e 100644
--- a/spec/saulabs/trueskill/factor_graph_spec.rb
+++ b/spec/saulabs/trueskill/factor_graph_spec.rb
@@ -13,18 +13,18 @@
   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)
+      expect(@skill.mean).to be_within(tolerance).of(30.38345)
     end
 
     it "should update the deviation of the first player in team1 to 3.46421" do
       @graph.update_skills
-      @skill.deviation.should be_within(tolerance).of(3.46421)
+      expect(@skill.deviation).to 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)
+      expect(@graph.draw_margin).to be_within(tolerance).of(0.740466)
     end
   end
 end
@@ -59,11 +59,11 @@
         end
 
         it "should change first players rating to [29.395832, 7.1714755]" do
-          teams[0][0].should eql_rating(29.395832, 7.1714755)
+          expect(teams[0][0]).to eql_rating(29.395832, 7.1714755)
         end
 
         it "should change second players rating to [20.6041679, 7.1714755]" do
-          teams[1][0].should eql_rating(20.6041679, 7.1714755)
+          expect(teams[1][0]).to eql_rating(20.6041679, 7.1714755)
         end
 
       end
@@ -76,11 +76,11 @@
       end
 
       it "should change first players rating to [25.0, 6.4575196]" do
-        teams[0][0].should eql_rating(25.0, 6.4575196)
+        expect(teams[0][0]).to eql_rating(25.0, 6.4575196)
       end
 
       it "should change second players rating to [25.0, 6.4575196]" do
-        teams[1][0].should eql_rating(25.0, 6.4575196)
+        expect(teams[1][0]).to eql_rating(25.0, 6.4575196)
       end
 
     end
@@ -95,11 +95,11 @@
       end
 
       it "should change first players rating to [31.6623, 7.1374]" do
-        teams[0][0].should eql_rating(31.662301, 7.1374459)
+        expect(teams[0][0]).to eql_rating(31.662301, 7.1374459)
       end
 
       it "should change second players mean to [35.0107, 7.9101]" do
-        teams[1][0].should eql_rating(35.010653, 7.910077)
+        expect(teams[1][0]).to eql_rating(35.010653, 7.910077)
       end
 
     end
@@ -116,14 +116,14 @@
         describe "#@skill_update" do
           it "should have a Boolean @skills_additive = false" do
             @graph = TrueSkill::FactorGraph.new(draw_results, {:skills_additive => false})
-            @graph.skills_additive.should be_false
+            expect(@graph.skills_additive).to be_false
           end
 
           it "should update the mean of the first player in team1 to 25.0 after draw" do
             @graph = TrueSkill::FactorGraph.new(draw_results, {:skills_additive => false})
 
             @graph.update_skills
-            teams[0][0].mean.should be_within(tolerance).of(25.0)
+            expect(teams[0][0].mean).to be_within(tolerance).of(25.0)
           end
         end
       end
diff --git a/spec/saulabs/trueskill/factors/greater_than_spec.rb b/spec/saulabs/trueskill/factors/greater_than_spec.rb
index 7275693..50c84e3 100644
--- a/spec/saulabs/trueskill/factors/greater_than_spec.rb
+++ b/spec/saulabs/trueskill/factors/greater_than_spec.rb
@@ -11,7 +11,7 @@
   describe "#update_message_at" do
     
     it "should return a difference of 2.1409" do
-      @factor.update_message_at(0).should be_within(tolerance).of(2.1409)
+      expect(@factor.update_message_at(0)).to be_within(tolerance).of(2.1409)
     end
   
   end
@@ -19,7 +19,7 @@
   describe "#log_normalization" do
     
     it "should be -0.69314" do
-      @factor.log_normalization.should be_within(tolerance).of(-0.69314)
+      expect(@factor.log_normalization).to be_within(tolerance).of(-0.69314)
     end
   
   end
diff --git a/spec/saulabs/trueskill/factors/likelihood_spec.rb b/spec/saulabs/trueskill/factors/likelihood_spec.rb
index 356fa08..a30591d 100644
--- a/spec/saulabs/trueskill/factors/likelihood_spec.rb
+++ b/spec/saulabs/trueskill/factors/likelihood_spec.rb
@@ -12,12 +12,12 @@
   describe "#update_message_at" do
     
     it "should return a difference of 0.0" do
-      @factor.update_message_at(0).should be_within(tolerance).of(0.0)
+      expect(@factor.update_message_at(0)).to be_within(tolerance).of(0.0)
     end
     
     it "should return a difference of 0.833066 for the second message" do
       @factor.update_message_at(0)
-      @factor.update_message_at(1).should be_within(tolerance).of(0.833066)
+      expect(@factor.update_message_at(1)).to be_within(tolerance).of(0.833066)
     end
   
   end
@@ -25,7 +25,7 @@
   describe "#log_normalization" do
     
     it "should be 0.0" do
-      @factor.log_normalization.should == 0.0
+      expect(@factor.log_normalization).to eq(0.0)
     end
   
   end
diff --git a/spec/saulabs/trueskill/factors/prior_spec.rb b/spec/saulabs/trueskill/factors/prior_spec.rb
index 88467f7..51d9574 100644
--- a/spec/saulabs/trueskill/factors/prior_spec.rb
+++ b/spec/saulabs/trueskill/factors/prior_spec.rb
@@ -11,7 +11,7 @@
   describe "#update_message_at" do
     
     it "should return a difference of 73.33333" do
-      @factor.update_message_at(0).should be_within(tolerance).of(73.33333)
+      expect(@factor.update_message_at(0)).to be_within(tolerance).of(73.33333)
     end
   
   end
@@ -19,7 +19,7 @@
   describe "#log_normalization" do
     
     it "should be 0.0" do
-      @factor.log_normalization.should == 0.0
+      expect(@factor.log_normalization).to eq(0.0)
     end
   
   end
diff --git a/spec/saulabs/trueskill/factors/weighted_sum_spec.rb b/spec/saulabs/trueskill/factors/weighted_sum_spec.rb
index 5b5de90..dae809c 100644
--- a/spec/saulabs/trueskill/factors/weighted_sum_spec.rb
+++ b/spec/saulabs/trueskill/factors/weighted_sum_spec.rb
@@ -16,12 +16,12 @@
   describe "weights" do
     
     it "should setup the weights correctly" do
-      @factor.weights[0][0].should be_within(tolerance).of(0.5)
-      @factor.weights[1][0].should be_within(tolerance).of(-1.4)
-      @factor.weights[2][0].should be_within(tolerance).of(-0.7142)
-      @factor.weights[2][1].should be_within(tolerance).of(-1.14285)
-      @factor.weights[3][0].should be_within(tolerance).of(-0.625)
-      @factor.weights[3][2].should be_within(tolerance).of(1.25)
+      expect(@factor.weights[0][0]).to be_within(tolerance).of(0.5)
+      expect(@factor.weights[1][0]).to be_within(tolerance).of(-1.4)
+      expect(@factor.weights[2][0]).to be_within(tolerance).of(-0.7142)
+      expect(@factor.weights[2][1]).to be_within(tolerance).of(-1.14285)
+      expect(@factor.weights[3][0]).to be_within(tolerance).of(-0.625)
+      expect(@factor.weights[3][2]).to be_within(tolerance).of(1.25)
     end
     
   end
@@ -29,12 +29,12 @@
   describe "weights_squared" do
     
     it "should setup the squared weights correctly" do
-      @factor.weights_squared[0][0].should be_within(tolerance).of(0.25)
-      @factor.weights_squared[1][0].should be_within(tolerance).of(1.96)
-      @factor.weights_squared[2][0].should be_within(tolerance).of(0.51)
-      @factor.weights_squared[2][1].should be_within(tolerance).of(1.3061)
-      @factor.weights_squared[3][0].should be_within(tolerance).of(0.3906)
-      @factor.weights_squared[3][2].should be_within(tolerance).of(1.5625)
+      expect(@factor.weights_squared[0][0]).to be_within(tolerance).of(0.25)
+      expect(@factor.weights_squared[1][0]).to be_within(tolerance).of(1.96)
+      expect(@factor.weights_squared[2][0]).to be_within(tolerance).of(0.51)
+      expect(@factor.weights_squared[2][1]).to be_within(tolerance).of(1.3061)
+      expect(@factor.weights_squared[3][0]).to be_within(tolerance).of(0.3906)
+      expect(@factor.weights_squared[3][2]).to be_within(tolerance).of(1.5625)
     end
     
   end
@@ -42,12 +42,12 @@
   describe "index_order" do
     
     it "should setup the index order correctly" do
-      @factor.index_order[0][0].should == 0
-      @factor.index_order[1][0].should == 1
-      @factor.index_order[2][0].should == 2
-      @factor.index_order[2][1].should == 1
-      @factor.index_order[2][2].should == 3
-      @factor.index_order[3][1].should == 1
+      expect(@factor.index_order[0][0]).to eq(0)
+      expect(@factor.index_order[1][0]).to eq(1)
+      expect(@factor.index_order[2][0]).to eq(2)
+      expect(@factor.index_order[2][1]).to eq(1)
+      expect(@factor.index_order[2][2]).to eq(3)
+      expect(@factor.index_order[3][1]).to eq(1)
     end
     
   end
@@ -55,7 +55,7 @@
   describe "#update_message_at" do
     
     it "should return a difference of 4.50116 for message 0" do
-      @factor.update_message_at(0).should be_within(tolerance).of(4.50116)
+      expect(@factor.update_message_at(0)).to be_within(tolerance).of(4.50116)
     end
   
   end
diff --git a/spec/saulabs/trueskill/factors/within_spec.rb b/spec/saulabs/trueskill/factors/within_spec.rb
index 028cd9c..535b1d4 100644
--- a/spec/saulabs/trueskill/factors/within_spec.rb
+++ b/spec/saulabs/trueskill/factors/within_spec.rb
@@ -11,7 +11,7 @@
   describe "#update_message_at" do
     
     it "should return a difference of 173.2048" do
-      @factor.update_message_at(0).should be_within(tolerance).of(173.2048)
+      expect(@factor.update_message_at(0)).to be_within(tolerance).of(173.2048)
     end
   
   end
@@ -19,7 +19,7 @@
   describe "#log_normalization" do
     
     it "should be -5.339497" do
-      @factor.log_normalization.should be_within(tolerance).of(-5.339497)
+      expect(@factor.log_normalization).to be_within(tolerance).of(-5.339497)
     end
   
   end
diff --git a/spec/saulabs/trueskill/layers/prior_to_skills_spec.rb b/spec/saulabs/trueskill/layers/prior_to_skills_spec.rb
index 9d638a4..49b7fae 100644
--- a/spec/saulabs/trueskill/layers/prior_to_skills_spec.rb
+++ b/spec/saulabs/trueskill/layers/prior_to_skills_spec.rb
@@ -13,15 +13,15 @@
   describe "#build" do
 
     it "should add 4 factors" do
-      lambda {
+      expect {
         @layer.build
-      }.should change(@layer.factors, :size).by(4)
+      }.to change(@layer.factors, :size).by(4)
     end
 
     it "should add 3 output variables" do
-      lambda {
+      expect {
         @layer.build
-      }.should change(@layer.output, :size).by(3)
+      }.to change(@layer.output, :size).by(3)
     end
 
   end
@@ -33,7 +33,7 @@
     end
 
     it "should return a sequence-schedule" do
-      @layer.prior_schedule.should be_kind_of(TrueSkill::Schedules::Sequence)
+      expect(@layer.prior_schedule).to be_kind_of(TrueSkill::Schedules::Sequence)
     end
 
   end
diff --git a/spec/saulabs/trueskill/score_based_bayesian_rating_spec.rb b/spec/saulabs/trueskill/score_based_bayesian_rating_spec.rb
index 9d9dda5..b02f536 100644
--- a/spec/saulabs/trueskill/score_based_bayesian_rating_spec.rb
+++ b/spec/saulabs/trueskill/score_based_bayesian_rating_spec.rb
@@ -22,7 +22,7 @@
     it "should update the mean of the first player in team1: " do
       test = TrueSkill::ScoreBasedBayesianRating.new(@results, {:gamma => 1, :beta => 10})
       test.update_skills
-      @teams[0][0].mean.should_not be_within(tolerance).of(25.0)
+      expect(@teams[0][0].mean).not_to be_within(tolerance).of(25.0)
     end
   end
   describe "#update_skills " do
@@ -30,7 +30,7 @@
     it "should update the mean of the first player in team1: skills additive => false" do
       test = TrueSkill::ScoreBasedBayesianRating.new(@results, {:gamma => 1, :beta => 10, :skills_additive => false})
       test.update_skills
-      @teams[0][0].mean.should_not be_within(tolerance).of(25.0)
+      expect(@teams[0][0].mean).not_to be_within(tolerance).of(25.0)
     end
   end
 end
@@ -52,7 +52,7 @@
     it "should update the mean of the first player in team1: " do
       test = TrueSkill::ScoreBasedBayesianRating.new(@results, {:gamma => 1, :beta => 10})
       test.update_skills
-      @teams[0][0].mean.should_not be_within(tolerance).of(25.0)
+      expect(@teams[0][0].mean).not_to be_within(tolerance).of(25.0)
     end
   end
   describe "#update_skills " do
@@ -60,7 +60,7 @@
     it "should update the mean of the first player in team1: skills additive => false" do
       test = TrueSkill::ScoreBasedBayesianRating.new(@results, {:gamma => 1, :beta => 10, :skills_additive => false})
       test.update_skills
-      @teams[0][0].mean.should_not be_within(tolerance).of(25.0)
+      expect(@teams[0][0].mean).not_to be_within(tolerance).of(25.0)
     end
   end
 end
@@ -83,7 +83,7 @@
     it "should update the mean of the first player in team1: " do
       test = TrueSkill::ScoreBasedBayesianRating.new(@results, {:gamma => 1, :beta => 10})
       test.update_skills
-      @teams[0][0].mean.should_not be_within(tolerance).of(25.0)
+      expect(@teams[0][0].mean).not_to be_within(tolerance).of(25.0)
     end
   end
   describe "#update_skills " do
@@ -91,7 +91,7 @@
     it "should update the mean of the first player in team1: skills additive => false" do
       test = TrueSkill::ScoreBasedBayesianRating.new(@results, {:gamma => 1, :beta => 10, :skills_additive => false})
       test.update_skills
-      @teams[0][0].mean.should_not be_within(tolerance).of(25.0)
+      expect(@teams[0][0].mean).not_to be_within(tolerance).of(25.0)
     end
   end
 end
@@ -113,7 +113,7 @@
     it "should update the mean of the first player in team1: " do
       test = TrueSkill::ScoreBasedBayesianRating.new(@results, {:gamma => 1, :beta => 10})
       test.update_skills
-      @teams[0][0].mean.should_not be_within(tolerance).of(25.0)
+      expect(@teams[0][0].mean).not_to be_within(tolerance).of(25.0)
     end
   end
   describe "#update_skills " do
@@ -121,7 +121,7 @@
     it "should update the mean of the first player in team1: skills additive => false" do
       test = TrueSkill::ScoreBasedBayesianRating.new(@results, {:gamma => 1, :beta => 10, :skills_additive => false})
       test.update_skills
-      @teams[0][0].mean.should_not be_within(tolerance).of(25.0)
+      expect(@teams[0][0].mean).not_to be_within(tolerance).of(25.0)
     end
   end
 end
@@ -145,7 +145,7 @@
     it "should update the mean of the first player in team1: " do
       test = TrueSkill::ScoreBasedBayesianRating.new(@results, {:gamma => 1, :beta => 10})
       test.update_skills
-      @teams[0][0].mean.should_not be_within(tolerance).of(25.0)
+      expect(@teams[0][0].mean).not_to be_within(tolerance).of(25.0)
     end
   end
   describe "#update_skills " do
@@ -153,7 +153,7 @@
     it "should update the mean of the first player in team1: skills additive => false" do
       test = TrueSkill::ScoreBasedBayesianRating.new(@results, {:gamma => 1, :beta => 10, :skills_additive => false})
       test.update_skills
-      @teams[0][0].mean.should_not be_within(tolerance).of(25.0)
+      expect(@teams[0][0].mean).not_to be_within(tolerance).of(25.0)
     end
   end
 end
@@ -175,7 +175,7 @@
     it "should update the mean of the first player in team1: " do
       test = TrueSkill::ScoreBasedBayesianRating.new(@results, {:gamma => 1, :beta => 10})
       test.update_skills
-      @teams[0][0].mean.should_not be_within(tolerance).of(25.0)
+      expect(@teams[0][0].mean).not_to be_within(tolerance).of(25.0)
     end
   end
   describe "#update_skills " do
@@ -183,7 +183,7 @@
     it "should update the mean of the first player in team1: skills additive => false" do
       test = TrueSkill::ScoreBasedBayesianRating.new(@results, {:gamma => 1, :beta => 10, :skills_additive => false})
       test.update_skills
-      @teams[0][0].mean.should_not be_within(tolerance).of(25.0)
+      expect(@teams[0][0].mean).not_to be_within(tolerance).of(25.0)
     end
   end
 end
@@ -205,7 +205,7 @@
     it "should update the mean of the first player in team1: " do
       test = TrueSkill::ScoreBasedBayesianRating.new(@results, {:gamma => 1, :beta => 10})
       test.update_skills
-      @teams[0][0].mean.should_not be_within(tolerance).of(25.0)
+      expect(@teams[0][0].mean).not_to be_within(tolerance).of(25.0)
     end
   end
   describe "#update_skills " do
@@ -213,7 +213,7 @@
     it "should update the mean of the first player in team1: skills additive => false" do
       test = TrueSkill::ScoreBasedBayesianRating.new(@results, {:gamma => 1, :beta => 10, :skills_additive => false})
       test.update_skills
-      @teams[0][0].mean.should be_within(tolerance).of(25.0)
+      expect(@teams[0][0].mean).to be_within(tolerance).of(25.0)
     end
   end
 end
@@ -236,7 +236,7 @@
     it "should update the mean of the first player in team1: " do
       test = TrueSkill::ScoreBasedBayesianRating.new(@results, {:gamma => 1, :beta => 10})
       test.update_skills
-      @teams[0][0].mean.should be_within(tolerance).of(25.0)
+      expect(@teams[0][0].mean).to be_within(tolerance).of(25.0)
     end
   end
 

From be37e147514f898dba254523501888903004f57a Mon Sep 17 00:00:00 2001
From: Patrick Brinich-Langlois <pbrinichlanglois@gmail.com>
Date: Thu, 9 May 2024 17:32:27 -0700
Subject: [PATCH 2/6] Fix RSpec deprecation warning

The warning was

    `be_false` is deprecated. Use `be_falsey` (for Ruby's conditional
    semantics) or `be false` (for exact `== false` equality) instead.
    Called from
    /Users/pat/academia/libraries/trueskill/spec/saulabs/trueskill/factor_graph_spec.rb:119:in
    `block (6 levels) in <top (required)>'.
---
 spec/saulabs/trueskill/factor_graph_spec.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/spec/saulabs/trueskill/factor_graph_spec.rb b/spec/saulabs/trueskill/factor_graph_spec.rb
index 3cdbc0e..439af01 100644
--- a/spec/saulabs/trueskill/factor_graph_spec.rb
+++ b/spec/saulabs/trueskill/factor_graph_spec.rb
@@ -116,7 +116,7 @@
         describe "#@skill_update" do
           it "should have a Boolean @skills_additive = false" do
             @graph = TrueSkill::FactorGraph.new(draw_results, {:skills_additive => false})
-            expect(@graph.skills_additive).to be_false
+            expect(@graph.skills_additive).to be false
           end
 
           it "should update the mean of the first player in team1 to 25.0 after draw" do

From ab62ada9fa9a70eee482d70724bcc4a351189115 Mon Sep 17 00:00:00 2001
From: Patrick Brinich-Langlois <pbrinichlanglois@gmail.com>
Date: Thu, 9 May 2024 17:51:32 -0700
Subject: [PATCH 3/6] Fix RSpec deprecation warning

The warning was

	TrueSkillMatchers::EqualRating implements a legacy RSpec matcher protocol.
    For the current protocol you should expose the failure messages via the
    `failure_message` and `failure_message_when_negated` methods.  (Used from
    /Users/pat/academia/libraries/trueskill/spec/saulabs/trueskill/factor_graph_spec.rb:66:in
    `block (5 levels) in <top (required)>')
---
 spec/true_skill_matchers.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/spec/true_skill_matchers.rb b/spec/true_skill_matchers.rb
index 42ccace..e8b8ce8 100644
--- a/spec/true_skill_matchers.rb
+++ b/spec/true_skill_matchers.rb
@@ -19,7 +19,7 @@ def failure_message
       "expected rating #{@target.to_s} to be equal to #{@expected.to_s} #{failure_info}"
     end
     
-    def negative_failure_message
+    def failure_message_when_negated
       "expected rating #{@target.to_s} not to be equal to #{@expected.to_s} #{failure_info}"
     end
     

From b329426af2caf12fd205718d60abddc0c1c359ad Mon Sep 17 00:00:00 2001
From: Patrick Brinich-Langlois <pbrinichlanglois@gmail.com>
Date: Thu, 9 May 2024 17:52:20 -0700
Subject: [PATCH 4/6] Upgrade RSpec

---
 Gemfile      |  5 ++---
 Gemfile.lock | 52 +++++++++++++++++++++++++---------------------------
 2 files changed, 27 insertions(+), 30 deletions(-)

diff --git a/Gemfile b/Gemfile
index 47a3fbb..1e2a68f 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,9 +1,8 @@
-source :gemcutter
+source "https://rubygems.org"
 
 gem 'rake'
-gem 'rspec', '2.99.0'
+gem 'rspec'
 gem 'simplecov'
 gem 'yard'
 gem 'yard-rspec'
 gem 'bluecloth'
-gem 'transpec'
diff --git a/Gemfile.lock b/Gemfile.lock
index fdf8183..21982e9 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -1,43 +1,41 @@
 GEM
-  remote: http://rubygems.org/
+  remote: https://rubygems.org/
   specs:
-    ast (2.4.2)
     bluecloth (2.2.0)
     diff-lcs (1.5.1)
-    multi_json (1.3.6)
-    parser (2.7.2.0)
-      ast (~> 2.4.1)
-    rainbow (1.99.2)
-    rake (0.9.2.2)
-    rspec (2.99.0)
-      rspec-core (~> 2.99.0)
-      rspec-expectations (~> 2.99.0)
-      rspec-mocks (~> 2.99.0)
-    rspec-core (2.99.2)
-    rspec-expectations (2.99.2)
-      diff-lcs (>= 1.1.3, < 2.0)
-    rspec-mocks (2.99.4)
-    simplecov (0.6.4)
-      multi_json (~> 1.0)
-      simplecov-html (~> 0.5.3)
-    simplecov-html (0.5.3)
-    transpec (0.2.6)
-      parser (~> 2.0)
-      rainbow (~> 1.1)
-      rspec (~> 2.14)
-    yard (0.8.2.1)
+    docile (1.4.0)
+    rake (13.2.1)
+    rspec (3.13.0)
+      rspec-core (~> 3.13.0)
+      rspec-expectations (~> 3.13.0)
+      rspec-mocks (~> 3.13.0)
+    rspec-core (3.13.0)
+      rspec-support (~> 3.13.0)
+    rspec-expectations (3.13.0)
+      diff-lcs (>= 1.2.0, < 2.0)
+      rspec-support (~> 3.13.0)
+    rspec-mocks (3.13.1)
+      diff-lcs (>= 1.2.0, < 2.0)
+      rspec-support (~> 3.13.0)
+    rspec-support (3.13.1)
+    simplecov (0.22.0)
+      docile (~> 1.1)
+      simplecov-html (~> 0.11)
+      simplecov_json_formatter (~> 0.1)
+    simplecov-html (0.12.3)
+    simplecov_json_formatter (0.1.4)
+    yard (0.9.36)
     yard-rspec (0.1)
       yard
 
 PLATFORMS
-  ruby
+  x86_64-darwin-23
 
 DEPENDENCIES
   bluecloth
   rake
-  rspec (= 2.99.0)
+  rspec
   simplecov
-  transpec
   yard
   yard-rspec
 

From f8372b85ef60ec8098d2a6775119b3eddbe5c888 Mon Sep 17 00:00:00 2001
From: Patrick Brinich-Langlois <pbrinichlanglois@gmail.com>
Date: Thu, 9 May 2024 17:52:27 -0700
Subject: [PATCH 5/6] Add .tool-versions file

Ruby 3.3.1 is the latest version.
---
 .tool-versions | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 .tool-versions

diff --git a/.tool-versions b/.tool-versions
new file mode 100644
index 0000000..51f617d
--- /dev/null
+++ b/.tool-versions
@@ -0,0 +1 @@
+ruby 3.3.1

From 4676aa4dd0de6a8a6d8671966932d15e112205b6 Mon Sep 17 00:00:00 2001
From: Patrick Brinich-Langlois <pbrinichlanglois@gmail.com>
Date: Thu, 9 May 2024 17:58:50 -0700
Subject: [PATCH 6/6] Bump Travis CI Ruby version

---
 .travis.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.travis.yml b/.travis.yml
index 26ef0c2..a195ba8 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,4 +1,4 @@
 language: ruby
 rvm:
-  - 1.9.3
+  - 3.3.1
 script: "rake spec"