icu_tournament 1.9.3 → 1.10.0

Sign up to get free protection for your applications and to get access to all the features.
data/spec/result_spec.rb CHANGED
@@ -5,137 +5,137 @@ module ICU
5
5
  describe Result do
6
6
  context "a typical result" do
7
7
  it "should have a round, player number and score plus optional opponent number, colour and rateable flag" do
8
- lambda { Result.new(3, 5, 'W', :opponent => 11, :colour => 'W') }.should_not raise_error
8
+ expect { Result.new(3, 5, 'W', :opponent => 11, :colour => 'W') }.not_to raise_error
9
9
  end
10
10
  end
11
11
 
12
12
  context "round number" do
13
13
  it "should be a positive integer" do
14
- lambda { Result.new(-2, 2, 0) }.should raise_error(/invalid positive integer/)
15
- lambda { Result.new(0, 2, 0) }.should raise_error(/invalid positive integer/)
16
- Result.new(1, 2, 0).round.should == 1
17
- Result.new(' 3 ', 2, 0).round.should == 3
14
+ expect { Result.new(-2, 2, 0) }.to raise_error(/invalid positive integer/)
15
+ expect { Result.new(0, 2, 0) }.to raise_error(/invalid positive integer/)
16
+ expect(Result.new(1, 2, 0).round).to eq(1)
17
+ expect(Result.new(' 3 ', 2, 0).round).to eq(3)
18
18
  end
19
19
  end
20
20
 
21
21
  context "player number" do
22
22
  it "should be an integer" do
23
- lambda { Result.new(1, ' ', 0) }.should raise_error(/invalid integer/)
24
- Result.new(1, 2, 0).player.should == 2
25
- Result.new(1, ' 0 ', 0).player.should == 0
26
- Result.new(1, -5, 0).player.should == -5
27
- Result.new(1, " 9 ", 0).player.should == 9
23
+ expect { Result.new(1, ' ', 0) }.to raise_error(/invalid integer/)
24
+ expect(Result.new(1, 2, 0).player).to eq(2)
25
+ expect(Result.new(1, ' 0 ', 0).player).to eq(0)
26
+ expect(Result.new(1, -5, 0).player).to eq(-5)
27
+ expect(Result.new(1, " 9 ", 0).player).to eq(9)
28
28
  end
29
29
  end
30
30
 
31
31
  context "score" do
32
32
  [1, 1.0, 'W', 'w', '+'].each do |score|
33
33
  it "should be 'W' for #{score}, #{score.class}" do
34
- Result.new(1, 2, score).score.should == 'W'
34
+ expect(Result.new(1, 2, score).score).to eq('W')
35
35
  end
36
36
  end
37
37
  [0, 0.0, 'L', 'l', '-'].each do |score|
38
38
  it "should be 'L' for #{score}, #{score.class}" do
39
- Result.new(1, 2, score).score.should == 'L'
39
+ expect(Result.new(1, 2, score).score).to eq('L')
40
40
  end
41
41
  end
42
42
  ['½', 0.5, 'D', 'd', '='].each do |score|
43
43
  it "should be 'L' for #{score}, #{score.class}" do
44
- Result.new(1, 2, score).score.should == 'D'
44
+ expect(Result.new(1, 2, score).score).to eq('D')
45
45
  end
46
46
  end
47
47
  ['', ' ', 'x', 2, -1.0, nil].each do |score|
48
48
  it "should raise error for invalid score (#{score})" do
49
- lambda { Result.new(1, 2, score) }.should raise_error(/invalid score/)
49
+ expect { Result.new(1, 2, score) }.to raise_error(/invalid score/)
50
50
  end
51
51
  end
52
52
  it "should be expressable as a number" do
53
- Result.new(1, 2, 'W').points.should == 1.0
54
- Result.new(1, 2, 'L').points.should == 0.0
55
- Result.new(1, 2, 'D').points.should == 0.5
53
+ expect(Result.new(1, 2, 'W').points).to eq(1.0)
54
+ expect(Result.new(1, 2, 'L').points).to eq(0.0)
55
+ expect(Result.new(1, 2, 'D').points).to eq(0.5)
56
56
  end
57
57
  end
58
58
 
59
59
  context "colour" do
60
60
  it "should be 'W' or 'B' or nil (unknown)" do
61
- Result.new(4, 1, 0).colour.should be_nil
62
- Result.new(4, 1, 0, :colour => 'W').colour.should == 'W'
63
- Result.new(4, 1, 0, :colour => 'white').colour.should == 'W'
64
- Result.new(4, 1, 0, :colour => ' b ').colour.should == 'B'
65
- Result.new(4, 1, 0, :colour => ' BLACK ').colour.should == 'B'
66
- lambda { Result.new(4, 1, 0, :colour => 'red') }.should raise_error(/invalid colour/)
61
+ expect(Result.new(4, 1, 0).colour).to be_nil
62
+ expect(Result.new(4, 1, 0, :colour => 'W').colour).to eq('W')
63
+ expect(Result.new(4, 1, 0, :colour => 'white').colour).to eq('W')
64
+ expect(Result.new(4, 1, 0, :colour => ' b ').colour).to eq('B')
65
+ expect(Result.new(4, 1, 0, :colour => ' BLACK ').colour).to eq('B')
66
+ expect { Result.new(4, 1, 0, :colour => 'red') }.to raise_error(/invalid colour/)
67
67
  end
68
68
  end
69
69
 
70
70
  context "opponent number" do
71
71
  it "should be nil (the default) or an integer" do
72
- Result.new(4, 1, 0).opponent.should be_nil
73
- Result.new(4, 1, 0, :opponent => nil).opponent.should be_nil
74
- Result.new(4, 1, 0, :opponent => ' ').opponent.should be_nil
75
- Result.new(4, 1, 0, :opponent => 0).opponent.should == 0
76
- Result.new(4, 1, 0, :opponent => 2).opponent.should == 2
77
- Result.new(4, 1, 0, :opponent => -6).opponent.should == -6
78
- Result.new(4, 1, 0, :opponent => ' 10 ').opponent.should == 10
79
- lambda { Result.new(4, 1, 0, :opponent => 'X') }.should raise_error(/invalid opponent number/)
72
+ expect(Result.new(4, 1, 0).opponent).to be_nil
73
+ expect(Result.new(4, 1, 0, :opponent => nil).opponent).to be_nil
74
+ expect(Result.new(4, 1, 0, :opponent => ' ').opponent).to be_nil
75
+ expect(Result.new(4, 1, 0, :opponent => 0).opponent).to eq(0)
76
+ expect(Result.new(4, 1, 0, :opponent => 2).opponent).to eq(2)
77
+ expect(Result.new(4, 1, 0, :opponent => -6).opponent).to eq(-6)
78
+ expect(Result.new(4, 1, 0, :opponent => ' 10 ').opponent).to eq(10)
79
+ expect { Result.new(4, 1, 0, :opponent => 'X') }.to raise_error(/invalid opponent number/)
80
80
  end
81
81
 
82
82
  it "should be different to player number" do
83
- lambda { Result.new(4, 1, 0, :opponent => 1) }.should raise_error(/opponent .* player .* different/)
83
+ expect { Result.new(4, 1, 0, :opponent => 1) }.to raise_error(/opponent .* player .* different/)
84
84
  end
85
85
  end
86
86
 
87
87
  context "rateable flag" do
88
88
  it "should default to false if there is no opponent" do
89
- Result.new(4, 1, 0).rateable.should be_false
89
+ expect(Result.new(4, 1, 0).rateable).to be_falsey
90
90
  end
91
91
 
92
92
  it "should default to true if there is an opponent" do
93
- Result.new(4, 1, 0, :opponent => 10).rateable.should be_true
93
+ expect(Result.new(4, 1, 0, :opponent => 10).rateable).to be_truthy
94
94
  end
95
95
 
96
96
  it "should change if an opponent is added" do
97
97
  r = Result.new(4, 1, 0)
98
98
  r.opponent = 5;
99
- r.rateable.should be_true
99
+ expect(r.rateable).to be_truthy
100
100
  end
101
101
 
102
102
  it "should be settable to false from the constructor" do
103
- Result.new(4, 1, 0, :opponent => 10, :rateable => false).rateable.should be_false
103
+ expect(Result.new(4, 1, 0, :opponent => 10, :rateable => false).rateable).to be_falsey
104
104
  end
105
105
 
106
106
  it "should be settable to false using the accessor" do
107
107
  r = Result.new(4, 1, 0, :opponent => 10)
108
108
  r.rateable= false
109
- r.rateable.should be_false
109
+ expect(r.rateable).to be_falsey
110
110
  end
111
111
 
112
112
  it "should not be settable to true if there is no opponent" do
113
113
  r = Result.new(4, 1, 0)
114
114
  r.rateable= true
115
- r.rateable.should be_false
115
+ expect(r.rateable).to be_falsey
116
116
  end
117
117
  end
118
118
 
119
119
  context "reversed result" do
120
120
  it "should be nil if there is no opponent" do
121
- Result.new(4, 1, 0).reverse.should be_nil
121
+ expect(Result.new(4, 1, 0).reverse).to be_nil
122
122
  end
123
123
 
124
124
  it "should have player and opponent swapped" do
125
125
  r = Result.new(4, 1, 0, :opponent => 2).reverse
126
- r.player.should == 2
127
- r.opponent.should == 1
126
+ expect(r.player).to eq(2)
127
+ expect(r.opponent).to eq(1)
128
128
  end
129
129
 
130
130
  it "should have reversed result" do
131
- Result.new(4, 1, 0, :opponent => 2).reverse.score.should == 'W'
132
- Result.new(4, 1, 1, :opponent => 2).reverse.score.should == 'L'
133
- Result.new(4, 1, '=', :opponent => 2).reverse.score.should == 'D'
131
+ expect(Result.new(4, 1, 0, :opponent => 2).reverse.score).to eq('W')
132
+ expect(Result.new(4, 1, 1, :opponent => 2).reverse.score).to eq('L')
133
+ expect(Result.new(4, 1, '=', :opponent => 2).reverse.score).to eq('D')
134
134
  end
135
135
 
136
136
  it "should preserve rateability" do
137
- Result.new(4, 1, 0, :opponent => 2).reverse.rateable.should be_true
138
- Result.new(4, 1, 0, :opponent => 2, :rateable => false).reverse.rateable.should be_false
137
+ expect(Result.new(4, 1, 0, :opponent => 2).reverse.rateable).to be_truthy
138
+ expect(Result.new(4, 1, 0, :opponent => 2, :rateable => false).reverse.rateable).to be_falsey
139
139
  end
140
140
  end
141
141
 
@@ -147,14 +147,14 @@ module ICU
147
147
 
148
148
  it "should renumber successfully if the map has the relevant player numbers" do
149
149
  map = { 4 => 1, 3 => 2 }
150
- @r1.renumber(map).player.should == 1
151
- @r2.renumber(map).player.should == 2
152
- @r1.opponent.should be_nil
153
- @r2.opponent.should == 1
150
+ expect(@r1.renumber(map).player).to eq(1)
151
+ expect(@r2.renumber(map).player).to eq(2)
152
+ expect(@r1.opponent).to be_nil
153
+ expect(@r2.opponent).to eq(1)
154
154
  end
155
155
 
156
156
  it "should raise exception if a player number is not in the map" do
157
- lambda { @r1.renumber({ 5 => 1, 3 => 2 }) }.should raise_error(/player.*4.*not found/)
157
+ expect { @r1.renumber({ 5 => 1, 3 => 2 }) }.to raise_error(/player.*4.*not found/)
158
158
  end
159
159
  end
160
160
 
@@ -169,19 +169,19 @@ module ICU
169
169
  end
170
170
 
171
171
  it "should only be equal if everything is the same" do
172
- @r.eql?(@r).should be_true
173
- @r.eql?(@r1).should be_true
174
- @r.eql?(@r2).should be_false
175
- @r.eql?(@r3).should be_false
176
- @r.eql?(@r4).should be_false
177
- @r.eql?(@r5).should be_false
172
+ expect(@r.eql?(@r)).to be_truthy
173
+ expect(@r.eql?(@r1)).to be_truthy
174
+ expect(@r.eql?(@r2)).to be_falsey
175
+ expect(@r.eql?(@r3)).to be_falsey
176
+ expect(@r.eql?(@r4)).to be_falsey
177
+ expect(@r.eql?(@r5)).to be_falsey
178
178
  end
179
179
 
180
180
  it "exceptions are allowed" do
181
- @r.eql?(@r2, :except => :rateable).should be_true
182
- @r.eql?(@r3, :except => "round").should be_true
183
- @r.eql?(@r4, :except => :colour).should be_true
184
- @r.eql?(@r5, :except => [:colour, :round, :score, "opponent"]).should be_true
181
+ expect(@r.eql?(@r2, :except => :rateable)).to be_truthy
182
+ expect(@r.eql?(@r3, :except => "round")).to be_truthy
183
+ expect(@r.eql?(@r4, :except => :colour)).to be_truthy
184
+ expect(@r.eql?(@r5, :except => [:colour, :round, :score, "opponent"])).to be_truthy
185
185
  end
186
186
  end
187
187
 
@@ -194,11 +194,11 @@ module ICU
194
194
  end
195
195
 
196
196
  it "should be correct" do
197
- @r.eql?(@r1).should be_true
198
- @r.eql?(@r2).should be_false
199
- @r.eql?(@r3).should be_false
200
- @r.eql?(@r2, :except => :rateable).should be_true
201
- @r.eql?(@r3, :except => [:rateable, :score]).should be_true
197
+ expect(@r.eql?(@r1)).to be_truthy
198
+ expect(@r.eql?(@r2)).to be_falsey
199
+ expect(@r.eql?(@r3)).to be_falsey
200
+ expect(@r.eql?(@r2, :except => :rateable)).to be_truthy
201
+ expect(@r.eql?(@r3, :except => [:rateable, :score])).to be_truthy
202
202
  end
203
203
  end
204
204
  end
data/spec/team_spec.rb CHANGED
@@ -11,49 +11,49 @@ module ICU
11
11
  end
12
12
 
13
13
  it "should have a name" do
14
- @t.name.should == 'Wandering Dragons'
14
+ expect(@t.name).to eq('Wandering Dragons')
15
15
  end
16
16
 
17
17
  it "should have some members" do
18
- @t.should have(3).members
19
- @t.include?(0).should be_true
20
- @t.include?(3).should be_true
21
- @t.include?(-7).should be_true
22
- @t.include?(7).should be_false
18
+ expect(@t.members.size).to eq(3)
19
+ expect(@t.include?(0)).to be_truthy
20
+ expect(@t.include?(3)).to be_truthy
21
+ expect(@t.include?(-7)).to be_truthy
22
+ expect(@t.include?(7)).to be_falsey
23
23
  end
24
24
 
25
25
  it "should match names ignoring case and irrelevant whitespace" do
26
- @t.matches('Wandering Dragons').should be_true
27
- @t.matches(' wandering dragons ').should be_true
28
- @t.matches(' wanderingdragons ').should be_false
29
- @t.matches('Blundering Bishops').should be_false
26
+ expect(@t.matches('Wandering Dragons')).to be_truthy
27
+ expect(@t.matches(' wandering dragons ')).to be_truthy
28
+ expect(@t.matches(' wanderingdragons ')).to be_falsey
29
+ expect(@t.matches('Blundering Bishops')).to be_falsey
30
30
  end
31
31
 
32
32
  it "should have a changeable name with irrelevant whitespace being trimmed" do
33
33
  @t.name = ' blue dragons '
34
- @t.name.should == 'blue dragons'
34
+ expect(@t.name).to eq('blue dragons')
35
35
  end
36
36
 
37
37
  it "should blowup if an attempt is made to blank the name" do
38
- lambda { @t.name = ' ' }.should raise_error(/blank/)
38
+ expect { @t.name = ' ' }.to raise_error(/blank/)
39
39
  end
40
40
 
41
41
  it "should blowup if an attempt is made to add a non-number" do
42
- lambda { @t.add_member(' ') }.should raise_error(/number/)
42
+ expect { @t.add_member(' ') }.to raise_error(/number/)
43
43
  end
44
44
 
45
45
  it "should blow up if an attempt is made to add a duplicate number" do
46
- lambda { @t.add_member(3) }.should raise_error(/duplicate/)
46
+ expect { @t.add_member(3) }.to raise_error(/duplicate/)
47
47
  end
48
48
 
49
49
  it "should renumber successfully if the map has the relevant player numbers" do
50
50
  map = { 0 => 1, 3 => 2, -7 => 3 }
51
51
  @t.renumber(map)
52
- @t.members.sort.join('').should == '123'
52
+ expect(@t.members.sort.join('')).to eq('123')
53
53
  end
54
54
 
55
55
  it "should raise exception if a player is missing from the renumber map" do
56
- lambda { @t.renumber({ 5 => 1, 3 => 2 }) }.should raise_error(/player.*not found/)
56
+ expect { @t.renumber({ 5 => 1, 3 => 2 }) }.to raise_error(/player.*not found/)
57
57
  end
58
58
  end
59
59
  end
@@ -4,84 +4,84 @@ module ICU
4
4
  describe TieBreak do
5
5
  context "#identify which rule" do
6
6
  it "should recognize Buchholz" do
7
- TieBreak.identify(:buchholz).id.should == :buchholz
8
- TieBreak.identify(" BucholtS ").id.should == :buchholz
9
- TieBreak.identify(" bh ").id.should == :buchholz
10
- TieBreak.identify(" buccholts ").code.should == "BH"
7
+ expect(TieBreak.identify(:buchholz).id).to eq(:buchholz)
8
+ expect(TieBreak.identify(" BucholtS ").id).to eq(:buchholz)
9
+ expect(TieBreak.identify(" bh ").id).to eq(:buchholz)
10
+ expect(TieBreak.identify(" buccholts ").code).to eq("BH")
11
11
  end
12
12
 
13
13
  it "should recognize Harkness (Median)" do
14
- TieBreak.identify(:harkness).id.should == :harkness
15
- TieBreak.identify("median").id.should == :harkness
16
- TieBreak.identify(" hARKNES ").id.should == :harkness
17
- TieBreak.identify("HK").id.should == :harkness
18
- TieBreak.identify("MEDIAN").code.should == "HK"
14
+ expect(TieBreak.identify(:harkness).id).to eq(:harkness)
15
+ expect(TieBreak.identify("median").id).to eq(:harkness)
16
+ expect(TieBreak.identify(" hARKNES ").id).to eq(:harkness)
17
+ expect(TieBreak.identify("HK").id).to eq(:harkness)
18
+ expect(TieBreak.identify("MEDIAN").code).to eq("HK")
19
19
  end
20
20
 
21
21
  it "should recognize Modified Median" do
22
- TieBreak.identify(:modified).id.should == :modified_median
23
- TieBreak.identify(" modified MEDIAN ").id.should == :modified_median
24
- TieBreak.identify("MM").code.should == "MM"
22
+ expect(TieBreak.identify(:modified).id).to eq(:modified_median)
23
+ expect(TieBreak.identify(" modified MEDIAN ").id).to eq(:modified_median)
24
+ expect(TieBreak.identify("MM").code).to eq("MM")
25
25
  end
26
26
 
27
27
  it "should recognize Number of Blacks" do
28
- TieBreak.identify(:blacks).id.should == :blacks
29
- TieBreak.identify("number\tof\tblacks\n").id.should == :blacks
30
- TieBreak.identify("\tnb\t").id.should == :blacks
31
- TieBreak.identify("number_blacks").code.should == "NB"
28
+ expect(TieBreak.identify(:blacks).id).to eq(:blacks)
29
+ expect(TieBreak.identify("number\tof\tblacks\n").id).to eq(:blacks)
30
+ expect(TieBreak.identify("\tnb\t").id).to eq(:blacks)
31
+ expect(TieBreak.identify("number_blacks").code).to eq("NB")
32
32
  end
33
33
 
34
34
  it "should recognize Number of Wins" do
35
- TieBreak.identify(:wins).id.should == :wins
36
- TieBreak.identify(" number-of-wins ").id.should == :wins
37
- TieBreak.identify("NUMBER WINS\r\n").id.should == :wins
38
- TieBreak.identify("nw").code.should == "NW"
35
+ expect(TieBreak.identify(:wins).id).to eq(:wins)
36
+ expect(TieBreak.identify(" number-of-wins ").id).to eq(:wins)
37
+ expect(TieBreak.identify("NUMBER WINS\r\n").id).to eq(:wins)
38
+ expect(TieBreak.identify("nw").code).to eq("NW")
39
39
  end
40
40
 
41
41
  it "should recognize Player's of Name" do
42
- TieBreak.identify(:name).id.should == :name
43
- TieBreak.identify("Player's Name").id.should == :name
44
- TieBreak.identify("players_name").id.should == :name
45
- TieBreak.identify("PN").id.should == :name
46
- TieBreak.identify("PLAYER-NAME").code.should == "PN"
42
+ expect(TieBreak.identify(:name).id).to eq(:name)
43
+ expect(TieBreak.identify("Player's Name").id).to eq(:name)
44
+ expect(TieBreak.identify("players_name").id).to eq(:name)
45
+ expect(TieBreak.identify("PN").id).to eq(:name)
46
+ expect(TieBreak.identify("PLAYER-NAME").code).to eq("PN")
47
47
  end
48
48
 
49
49
  it "should recognize Sonneborn-Berger" do
50
- TieBreak.identify(:sonneborn_berger).id.should == :neustadtl
51
- TieBreak.identify(:neustadtl).id.should == :neustadtl
52
- TieBreak.identify(" SONNEBORN\nberger").id.should == :neustadtl
53
- TieBreak.identify("\t soneborn_berger \t").id.should == :neustadtl
54
- TieBreak.identify("sb").id.should == :neustadtl
55
- TieBreak.identify("NESTADL").code.should == "SB"
50
+ expect(TieBreak.identify(:sonneborn_berger).id).to eq(:neustadtl)
51
+ expect(TieBreak.identify(:neustadtl).id).to eq(:neustadtl)
52
+ expect(TieBreak.identify(" SONNEBORN\nberger").id).to eq(:neustadtl)
53
+ expect(TieBreak.identify("\t soneborn_berger \t").id).to eq(:neustadtl)
54
+ expect(TieBreak.identify("sb").id).to eq(:neustadtl)
55
+ expect(TieBreak.identify("NESTADL").code).to eq("SB")
56
56
  end
57
57
 
58
58
  it "should recognize Sum of Progressive Scores" do
59
- TieBreak.identify(:progressive).id.should == :progressive
60
- TieBreak.identify("CUMULATIVE").id.should == :progressive
61
- TieBreak.identify("sum of progressive scores").id.should == :progressive
62
- TieBreak.identify("SUM-cumulative_SCORE").id.should == :progressive
63
- TieBreak.identify(:cumulative_score).id.should == :progressive
64
- TieBreak.identify("SumOfCumulative").id.should == :progressive
65
- TieBreak.identify("SP").code.should == "SP"
59
+ expect(TieBreak.identify(:progressive).id).to eq(:progressive)
60
+ expect(TieBreak.identify("CUMULATIVE").id).to eq(:progressive)
61
+ expect(TieBreak.identify("sum of progressive scores").id).to eq(:progressive)
62
+ expect(TieBreak.identify("SUM-cumulative_SCORE").id).to eq(:progressive)
63
+ expect(TieBreak.identify(:cumulative_score).id).to eq(:progressive)
64
+ expect(TieBreak.identify("SumOfCumulative").id).to eq(:progressive)
65
+ expect(TieBreak.identify("SP").code).to eq("SP")
66
66
  end
67
67
 
68
68
  it "should recognize Sum of Opponents' Ratings" do
69
- TieBreak.identify(:ratings).id.should == :ratings
70
- TieBreak.identify("sum of opponents ratings").id.should == :ratings
71
- TieBreak.identify("Opponents' Ratings").id.should == :ratings
72
- TieBreak.identify("SR").id.should == :ratings
73
- TieBreak.identify("SUMOPPONENTSRATINGS").code.should == "SR"
69
+ expect(TieBreak.identify(:ratings).id).to eq(:ratings)
70
+ expect(TieBreak.identify("sum of opponents ratings").id).to eq(:ratings)
71
+ expect(TieBreak.identify("Opponents' Ratings").id).to eq(:ratings)
72
+ expect(TieBreak.identify("SR").id).to eq(:ratings)
73
+ expect(TieBreak.identify("SUMOPPONENTSRATINGS").code).to eq("SR")
74
74
  end
75
75
 
76
76
  it "should recognize player's name" do
77
- TieBreak.identify(:name).id.should == :name
78
- TieBreak.identify(" player's NAME ").id.should == :name
79
- TieBreak.identify("pn").code.should == "PN"
77
+ expect(TieBreak.identify(:name).id).to eq(:name)
78
+ expect(TieBreak.identify(" player's NAME ").id).to eq(:name)
79
+ expect(TieBreak.identify("pn").code).to eq("PN")
80
80
  end
81
81
 
82
82
  it "should return nil for unrecognized tie breaks" do
83
- TieBreak.identify("XYZ").should be_nil
84
- TieBreak.identify(nil).should be_nil
83
+ expect(TieBreak.identify("XYZ")).to be_nil
84
+ expect(TieBreak.identify(nil)).to be_nil
85
85
  end
86
86
  end
87
87
 
@@ -91,9 +91,9 @@ module ICU
91
91
  end
92
92
 
93
93
  it "should be an array in a specific order" do
94
- @rules.size.should == 9
95
- @rules.first.name.should == "Buchholz"
96
- @rules.map(&:code).join("|").should == "BH|HK|MM|NB|NW|PN|SB|SR|SP"
94
+ expect(@rules.size).to eq(9)
95
+ expect(@rules.first.name).to eq("Buchholz")
96
+ expect(@rules.map(&:code).join("|")).to eq("BH|HK|MM|NB|NW|PN|SB|SR|SP")
97
97
  end
98
98
  end
99
99
  end