icu_name 1.2.3 → 1.2.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b61ee47e3e82a7cdac3cf69ac165580200611467
4
- data.tar.gz: 15dea81cd76de6cd8612b85788e99692ba057ce9
3
+ metadata.gz: d725aed8697e26c01cf8c7c4e3e93cab0d917fea
4
+ data.tar.gz: ed22567cfb399c6a3696f49086987cff2e9db1f2
5
5
  SHA512:
6
- metadata.gz: 9c7238be2547ffd6d1ea2cf8a563848363b04215f7b402070b33ab955847bcbddbe8f312df61d18c9b7322e3d3df8b35df55d09a2bfc44f5fa4936e9fae2dba1
7
- data.tar.gz: 344a82a3885730ef92a8485d98042f10fe974ca22668790aa43eef0f8da1d7732ac119fd9563500088628b9cc53cfd3d80dfae91a69f7203779cf98dbd723a5b
6
+ metadata.gz: 4dc0324570e2ee4c4f05af666aa2ddba6e47906d204f87fb67e49bd98589a1eb24ba0ae294a9ec3c6f197fa7b3d9f1fc2634de6e9447537620d9315c76366aef
7
+ data.tar.gz: 2410e8711ea323b0b1d0da1a049cda4fc37f9a9799b0f9294a74fe75499221ec5adf592494d572f2988cc8c82373de7b16f86f50f00c8e8be1b30ce1412a2d48
@@ -6,7 +6,7 @@ Note: version 1.1.0 dropped support for characters beyond codepoint 255 and beca
6
6
 
7
7
  == Installation
8
8
 
9
- For ruby 1.9.2, 1.9.3, 2.0.0.
9
+ Tested with ruby 1.9.2, 1.9.3, 2.0.0 and 2.2.0.
10
10
 
11
11
  gem install icu_name
12
12
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module ICU
4
4
  class Name
5
- VERSION = "1.2.3"
5
+ VERSION = "1.2.4"
6
6
  end
7
7
  end
@@ -22,32 +22,32 @@ module ICU
22
22
  end
23
23
 
24
24
  it "#first returns the first name(s)" do
25
- @simple.first.should == 'Mark J. L.'
25
+ expect(@simple.first).to eq('Mark J. L.')
26
26
  end
27
27
 
28
28
  it "#last returns the last name(s)" do
29
- @simple.last.should == 'Orr'
29
+ expect(@simple.last).to eq('Orr')
30
30
  end
31
31
 
32
32
  it "#name returns the full name with first name(s) first" do
33
- @simple.name.should == 'Mark J. L. Orr'
33
+ expect(@simple.name).to eq('Mark J. L. Orr')
34
34
  end
35
35
 
36
36
  it "#rname returns the full name with last name(s) first" do
37
- @simple.rname.should == 'Orr, Mark J. L.'
37
+ expect(@simple.rname).to eq('Orr, Mark J. L.')
38
38
  end
39
39
 
40
40
  it "#to_s is the same as rname" do
41
- @simple.to_s.should == 'Orr, Mark J. L.'
41
+ expect(@simple.to_s).to eq('Orr, Mark J. L.')
42
42
  end
43
43
 
44
44
  it "#original returns the original data" do
45
- @simple.original.should == 'ORR, mark j l'
45
+ expect(@simple.original).to eq('ORR, mark j l')
46
46
  end
47
47
 
48
48
  it "#match returns true if and only if two names match" do
49
- @simple.match('mark j l orr').should be_true
50
- @simple.match('malcolm g l orr').should be_false
49
+ expect(@simple.match('mark j l orr')).to be_truthy
50
+ expect(@simple.match('malcolm g l orr')).to be_falsey
51
51
  end
52
52
  end
53
53
 
@@ -58,48 +58,48 @@ module ICU
58
58
  end
59
59
 
60
60
  it "should get Robert" do
61
- @robert.name.should == 'Robert J. Fischer'
61
+ expect(@robert.name).to eq('Robert J. Fischer')
62
62
  end
63
63
 
64
64
  it "should get Bobby" do
65
- @bobby.last.should == 'Fischer'
66
- @bobby.first.should == 'Bobby'
65
+ expect(@bobby.last).to eq('Fischer')
66
+ expect(@bobby.first).to eq('Bobby')
67
67
  end
68
68
 
69
69
  it "should match Robert and Bobby" do
70
- @robert.match(@bobby).should be_true
71
- @robert.match('R. J.', 'Fischer').should be_true
72
- @bobby.match('R. J.', 'Fischer').should be_false
70
+ expect(@robert.match(@bobby)).to be_truthy
71
+ expect(@robert.match('R. J.', 'Fischer')).to be_truthy
72
+ expect(@bobby.match('R. J.', 'Fischer')).to be_falsey
73
73
  end
74
74
 
75
75
  it "should canconicalise last names" do
76
- Name.new('John', 'O Reilly').last.should == "O'Reilly"
77
- Name.new('dave', 'mcmanus').last.should == "McManus"
78
- Name.new('pete', 'MACMANUS').last.should == "Macmanus"
76
+ expect(Name.new('John', 'O Reilly').last).to eq("O'Reilly")
77
+ expect(Name.new('dave', 'mcmanus').last).to eq("McManus")
78
+ expect(Name.new('pete', 'MACMANUS').last).to eq("Macmanus")
79
79
  end
80
80
 
81
81
  it "characters and encoding" do
82
- ICU::Name.new('éric', 'PRIÉ').name.should == "Éric Prié"
83
- ICU::Name.new('BARTŁOMIEJ', 'śliwa').name.should == "Bartomiej Liwa"
84
- ICU::Name.new('Սմբատ', 'Լպուտյան').name.should == ""
82
+ expect(ICU::Name.new('éric', 'PRIÉ').name).to eq("Éric Prié")
83
+ expect(ICU::Name.new('BARTŁOMIEJ', 'śliwa').name).to eq("Bartomiej Liwa")
84
+ expect(ICU::Name.new('Սմբատ', 'Լպուտյան').name).to eq("")
85
85
  eric = Name.new('éric'.encode("ISO-8859-1"), 'PRIÉ'.force_encoding("ASCII-8BIT"))
86
- eric.rname.should == "Prié, Éric"
87
- eric.rname.encoding.name.should == "UTF-8"
88
- eric.original.should == "PRIÉ, éric"
89
- eric.original.encoding.name.should == "UTF-8"
90
- eric.rname(:chars => "US-ASCII").should == "Prie, Eric"
91
- eric.original(:chars => "US-ASCII").should == "PRIE, eric"
92
- eric.match('Éric', 'Prié').should be_true
93
- eric.match('Eric', 'Prie').should be_false
94
- eric.match('Eric', 'Prie', :chars => "US-ASCII").should be_true
86
+ expect(eric.rname).to eq("Prié, Éric")
87
+ expect(eric.rname.encoding.name).to eq("UTF-8")
88
+ expect(eric.original).to eq("PRIÉ, éric")
89
+ expect(eric.original.encoding.name).to eq("UTF-8")
90
+ expect(eric.rname(:chars => "US-ASCII")).to eq("Prie, Eric")
91
+ expect(eric.original(:chars => "US-ASCII")).to eq("PRIE, eric")
92
+ expect(eric.match('Éric', 'Prié')).to be_truthy
93
+ expect(eric.match('Eric', 'Prie')).to be_falsey
94
+ expect(eric.match('Eric', 'Prie', :chars => "US-ASCII")).to be_truthy
95
95
  end
96
96
  end
97
97
 
98
98
  context "names that are already canonical" do
99
99
  it "should not be altered" do
100
- Name.new('Mark J. L.', 'Orr').name.should == 'Mark J. L. Orr'
101
- Name.new('Anna-Marie J.-K.', 'Liviu-Dieter').name.should == 'Anna-Marie J.-K. Liviu-Dieter'
102
- Name.new('Èric Cantona').name.should == 'Èric Cantona'
100
+ expect(Name.new('Mark J. L.', 'Orr').name).to eq('Mark J. L. Orr')
101
+ expect(Name.new('Anna-Marie J.-K.', 'Liviu-Dieter').name).to eq('Anna-Marie J.-K. Liviu-Dieter')
102
+ expect(Name.new('Èric Cantona').name).to eq('Èric Cantona')
103
103
  end
104
104
  end
105
105
 
@@ -109,113 +109,113 @@ module ICU
109
109
  end
110
110
 
111
111
  it "should use apostrophe (0027) as the canonical choice" do
112
- Name.new('una', "O'boyle").name.should == "Una O'Boyle"
113
- Name.new('Una', "o’boyle").name.should == "Una O'Boyle"
114
- Name.new('jonathan', 'd`arcy').name.should == "Jonathan D'Arcy"
115
- Name.new('erwin e', "L′AMI").name.should == "Erwin E. L'Ami"
116
- Name.new('cormac', "o brien").name.should == "Cormac O'Brien"
117
- Name.new('türko', "o özgür").name.should == "Türko O'Özgür"
118
- Name.new('türko', "l‘özgür").name.should == "Türko L'Özgür"
112
+ expect(Name.new('una', "O'boyle").name).to eq("Una O'Boyle")
113
+ expect(Name.new('Una', "o’boyle").name).to eq("Una O'Boyle")
114
+ expect(Name.new('jonathan', 'd`arcy').name).to eq("Jonathan D'Arcy")
115
+ expect(Name.new('erwin e', "L′AMI").name).to eq("Erwin E. L'Ami")
116
+ expect(Name.new('cormac', "o brien").name).to eq("Cormac O'Brien")
117
+ expect(Name.new('türko', "o özgür").name).to eq("Türko O'Özgür")
118
+ expect(Name.new('türko', "l‘özgür").name).to eq("Türko L'Özgür")
119
119
  end
120
120
 
121
121
  it "backticks (0060), opening (2018) and closing (2019) single quotes, primes (2032) and high reversed 9 quotes (201B) should be equivalent" do
122
- @una.match("Una", "O`Boyle").should be_true
123
- @una.match("Una", "O’Boyle").should be_true
124
- @una.match("Una", "O‘Boyle").should be_true
125
- @una.match("Una", "O′Boyle").should be_true
126
- @una.match("Una", "O‛Boyle").should be_true
127
- @una.match("Una", "O‚Boyle").should be_false
122
+ expect(@una.match("Una", "O`Boyle")).to be_truthy
123
+ expect(@una.match("Una", "O’Boyle")).to be_truthy
124
+ expect(@una.match("Una", "O‘Boyle")).to be_truthy
125
+ expect(@una.match("Una", "O′Boyle")).to be_truthy
126
+ expect(@una.match("Una", "O‛Boyle")).to be_truthy
127
+ expect(@una.match("Una", "O‚Boyle")).to be_falsey
128
128
  end
129
129
  end
130
130
 
131
131
  context "last beginning with Mc or Mac" do
132
132
  it "should be handled correctly" do
133
- Name.new('shane', "mccabe").name.should == "Shane McCabe"
134
- Name.new('shawn', "macdonagh").name.should == "Shawn Macdonagh"
135
- Name.new('Colin', "MacNab").name.should == "Colin MacNab"
136
- Name.new('colin', "macnab").name.should == "Colin Macnab"
137
- Name.new('bartlomiej', "macieja").name.should == "Bartlomiej Macieja"
138
- Name.new('türko', "mcözgür").name.should == "Türko McÖzgür"
139
- Name.new('TÜRKO', "MACÖZGÜR").name.should == "Türko Macözgür"
140
- Name.new('Türko', "MacÖzgür").name.should == "Türko MacÖzgür"
133
+ expect(Name.new('shane', "mccabe").name).to eq("Shane McCabe")
134
+ expect(Name.new('shawn', "macdonagh").name).to eq("Shawn Macdonagh")
135
+ expect(Name.new('Colin', "MacNab").name).to eq("Colin MacNab")
136
+ expect(Name.new('colin', "macnab").name).to eq("Colin Macnab")
137
+ expect(Name.new('bartlomiej', "macieja").name).to eq("Bartlomiej Macieja")
138
+ expect(Name.new('türko', "mcözgür").name).to eq("Türko McÖzgür")
139
+ expect(Name.new('TÜRKO', "MACÖZGÜR").name).to eq("Türko Macözgür")
140
+ expect(Name.new('Türko', "MacÖzgür").name).to eq("Türko MacÖzgür")
141
141
  end
142
142
  end
143
143
 
144
144
  context "first name initials" do
145
145
  it "should be handled correctly" do
146
- Name.new('m j l', 'Orr').first.should == 'M. J. L.'
147
- Name.new('Ö. é m', 'Panno').first.should == "Ö. É. M."
146
+ expect(Name.new('m j l', 'Orr').first).to eq('M. J. L.')
147
+ expect(Name.new('Ö. é m', 'Panno').first).to eq("Ö. É. M.")
148
148
  end
149
149
  end
150
150
 
151
151
  context "doubled barrelled names or initials" do
152
152
  it "should be handled correctly" do
153
- Name.new('anna-marie', 'den-otter').name.should == 'Anna-Marie Den-Otter'
154
- Name.new('j-k', 'rowling').name.should == 'J.-K. Rowling'
155
- Name.new("mark j. - l", 'ORR').name.should == 'Mark J.-L. Orr'
156
- Name.new('JOHANNA', "lowry-o'REILLY").name.should == "Johanna Lowry-O'Reilly"
157
- Name.new('hannah', "lowry - o reilly").name.should == "Hannah Lowry-O'Reilly"
158
- Name.new('hannah', "lowry - o reilly").name.should == "Hannah Lowry-O'Reilly"
159
- Name.new('ètienne', "gèrard - mcözgür").name.should == "Ètienne Gèrard-McÖzgür"
153
+ expect(Name.new('anna-marie', 'den-otter').name).to eq('Anna-Marie Den-Otter')
154
+ expect(Name.new('j-k', 'rowling').name).to eq('J.-K. Rowling')
155
+ expect(Name.new("mark j. - l", 'ORR').name).to eq('Mark J.-L. Orr')
156
+ expect(Name.new('JOHANNA', "lowry-o'REILLY").name).to eq("Johanna Lowry-O'Reilly")
157
+ expect(Name.new('hannah', "lowry - o reilly").name).to eq("Hannah Lowry-O'Reilly")
158
+ expect(Name.new('hannah', "lowry - o reilly").name).to eq("Hannah Lowry-O'Reilly")
159
+ expect(Name.new('ètienne', "gèrard - mcözgür").name).to eq("Ètienne Gèrard-McÖzgür")
160
160
  end
161
161
  end
162
162
 
163
163
  context "names with II, III or IV" do
164
164
  it "should be handled correctly" do
165
- Name.new('Jerry iIi', 'Jones').name.should == 'Jerry III Jones'
166
- Name.new('henry i', 'FORD II').name.should == 'Henry I. Ford II'
167
- Name.new('Paul IV', 'Pope').name.should == 'Paul IV Pope'
165
+ expect(Name.new('Jerry iIi', 'Jones').name).to eq('Jerry III Jones')
166
+ expect(Name.new('henry i', 'FORD II').name).to eq('Henry I. Ford II')
167
+ expect(Name.new('Paul IV', 'Pope').name).to eq('Paul IV Pope')
168
168
  end
169
169
  end
170
170
 
171
171
  context "accented characters and capitalisation" do
172
172
  it "should downcase upper case accented characters where appropriate" do
173
173
  name = Name.new('GEARÓIDÍN', 'UÍ LAIGHLÉIS')
174
- name.first.should == 'Gearóidín'
175
- name.last.should == 'Uí Laighléis'
174
+ expect(name.first).to eq('Gearóidín')
175
+ expect(name.last).to eq('Uí Laighléis')
176
176
  end
177
177
 
178
178
  it "should upcase upper case accented characters where appropriate" do
179
179
  name = Name.new('èric özgür')
180
- name.first.should == 'Èric'
181
- name.last.should == 'Özgür'
180
+ expect(name.first).to eq('Èric')
181
+ expect(name.last).to eq('Özgür')
182
182
  end
183
183
  end
184
184
 
185
185
  context "extraneous white space" do
186
186
  it "should be handled correctly" do
187
- Name.new(' mark j l ', " \t\r\n orr \n").name.should == 'Mark J. L. Orr'
187
+ expect(Name.new(' mark j l ', " \t\r\n orr \n").name).to eq('Mark J. L. Orr')
188
188
  end
189
189
  end
190
190
 
191
191
  context "extraneous full stops" do
192
192
  it "should be handled correctly" do
193
- Name.new('. mark j..l', 'orr.').name.should == 'Mark J. L. Orr'
193
+ expect(Name.new('. mark j..l', 'orr.').name).to eq('Mark J. L. Orr')
194
194
  end
195
195
  end
196
196
 
197
197
  context "construction from a single string" do
198
198
  it "should be possible in simple cases" do
199
- Name.new('ORR, mark j l').rname.should == 'Orr, Mark J. L.'
200
- Name.new('MARK J L ORR').rname.should == 'Orr, Mark J. L.'
201
- Name.new("j-k O'Reilly").rname.should == "O'Reilly, J.-K."
202
- Name.new("j-k O Reilly").rname.should == "O'Reilly, J.-K."
203
- Name.new('ètienne o o özgür').name.should == "Ètienne O. O'Özgür"
199
+ expect(Name.new('ORR, mark j l').rname).to eq('Orr, Mark J. L.')
200
+ expect(Name.new('MARK J L ORR').rname).to eq('Orr, Mark J. L.')
201
+ expect(Name.new("j-k O'Reilly").rname).to eq("O'Reilly, J.-K.")
202
+ expect(Name.new("j-k O Reilly").rname).to eq("O'Reilly, J.-K.")
203
+ expect(Name.new('ètienne o o özgür').name).to eq("Ètienne O. O'Özgür")
204
204
  end
205
205
  end
206
206
 
207
207
  context "construction from an instance" do
208
208
  it "should be possible" do
209
- Name.new(Name.new('ORR, mark j l')).name.should == 'Mark J. L. Orr'
209
+ expect(Name.new(Name.new('ORR, mark j l')).name).to eq('Mark J. L. Orr')
210
210
  end
211
211
  end
212
212
 
213
213
  context "the original input" do
214
214
  it "should be the original text unaltered except for white space" do
215
- Name.new(' Mark j l ', ' ORR ').original.should == 'ORR, Mark j l'
216
- Name.new(' Mark J. L. Orr ').original.should == 'Mark J. L. Orr'
217
- Name.new('Józef', 'Żabiński').original.should == 'Żabiński, Józef'
218
- Name.new('Ui Laigleis,Gearoidin').original.should == 'Ui Laigleis,Gearoidin'
215
+ expect(Name.new(' Mark j l ', ' ORR ').original).to eq('ORR, Mark j l')
216
+ expect(Name.new(' Mark J. L. Orr ').original).to eq('Mark J. L. Orr')
217
+ expect(Name.new('Józef', 'Żabiński').original).to eq('Żabiński, Józef')
218
+ expect(Name.new('Ui Laigleis,Gearoidin').original).to eq('Ui Laigleis,Gearoidin')
219
219
  end
220
220
  end
221
221
 
@@ -227,44 +227,44 @@ module ICU
227
227
 
228
228
  it "should handle UTF-8" do
229
229
  name = Name.new(@first, @last)
230
- name.first.should == @first
231
- name.last.should == @last
232
- name.first.encoding.name.should == "UTF-8"
233
- name.last.encoding.name.should == "UTF-8"
230
+ expect(name.first).to eq(@first)
231
+ expect(name.last).to eq(@last)
232
+ expect(name.first.encoding.name).to eq("UTF-8")
233
+ expect(name.last.encoding.name).to eq("UTF-8")
234
234
  end
235
235
 
236
236
  it "should handle ISO-8859-1" do
237
237
  name = Name.new(@first.encode("ISO-8859-1"), @last.encode("ISO-8859-1"))
238
- name.first.should == @first
239
- name.last.should == @last
240
- name.first.encoding.name.should == "UTF-8"
241
- name.last.encoding.name.should == "UTF-8"
238
+ expect(name.first).to eq(@first)
239
+ expect(name.last).to eq(@last)
240
+ expect(name.first.encoding.name).to eq("UTF-8")
241
+ expect(name.last.encoding.name).to eq("UTF-8")
242
242
  end
243
243
 
244
244
  it "should handle Windows-1252" do
245
245
  name = Name.new(@first.encode("Windows-1252"), @last.encode("Windows-1252"))
246
- name.first.should == @first
247
- name.last.should == @last
248
- name.first.encoding.name.should == "UTF-8"
249
- name.last.encoding.name.should == "UTF-8"
246
+ expect(name.first).to eq(@first)
247
+ expect(name.last).to eq(@last)
248
+ expect(name.first.encoding.name).to eq("UTF-8")
249
+ expect(name.last.encoding.name).to eq("UTF-8")
250
250
  end
251
251
 
252
252
  it "should handle ASCII-8BIT" do
253
253
  name = Name.new(@first.dup.force_encoding('ASCII-8BIT'), @last.dup.force_encoding('ASCII-8BIT'))
254
- name.first.should == @first
255
- name.last.should == @last
256
- name.first.encoding.name.should == "UTF-8"
257
- name.last.encoding.name.should == "UTF-8"
254
+ expect(name.first).to eq(@first)
255
+ expect(name.last).to eq(@last)
256
+ expect(name.first.encoding.name).to eq("UTF-8")
257
+ expect(name.last.encoding.name).to eq("UTF-8")
258
258
  end
259
259
 
260
260
  it "should handle US-ASCII" do
261
261
  @first = 'Gearoidin'
262
262
  @last = 'Ui Laighleis'
263
263
  name = Name.new(@first.encode("US-ASCII"), @last.encode("US-ASCII"))
264
- name.first.should == @first
265
- name.last.should == @last
266
- name.first.encoding.name.should == "UTF-8"
267
- name.last.encoding.name.should == "UTF-8"
264
+ expect(name.first).to eq(@first)
265
+ expect(name.last).to eq(@last)
266
+ expect(name.first.encoding.name).to eq("UTF-8")
267
+ expect(name.last.encoding.name).to eq("UTF-8")
268
268
  end
269
269
  end
270
270
 
@@ -275,35 +275,35 @@ module ICU
275
275
 
276
276
  it "should be a no-op for names that are already ASCII" do
277
277
  name = Name.new('Mark J. L.', 'Orr')
278
- name.first(@opt).should == 'Mark J. L.'
279
- name.last(@opt).should == 'Orr'
280
- name.name(@opt).should == 'Mark J. L. Orr'
281
- name.rname(@opt).should == 'Orr, Mark J. L.'
282
- name.to_s(@opt).should == 'Orr, Mark J. L.'
278
+ expect(name.first(@opt)).to eq('Mark J. L.')
279
+ expect(name.last(@opt)).to eq('Orr')
280
+ expect(name.name(@opt)).to eq('Mark J. L. Orr')
281
+ expect(name.rname(@opt)).to eq('Orr, Mark J. L.')
282
+ expect(name.to_s(@opt)).to eq('Orr, Mark J. L.')
283
283
  end
284
284
 
285
285
  it "should remove the accents from accented characters" do
286
286
  name = Name.new('Gearóidín', 'Uí Laighléis')
287
- name.first(@opt).should == 'Gearoidin'
288
- name.last(@opt).should == 'Ui Laighleis'
289
- name.name(@opt).should == 'Gearoidin Ui Laighleis'
290
- name.rname(@opt).should == 'Ui Laighleis, Gearoidin'
291
- name.to_s(@opt).should == 'Ui Laighleis, Gearoidin'
287
+ expect(name.first(@opt)).to eq('Gearoidin')
288
+ expect(name.last(@opt)).to eq('Ui Laighleis')
289
+ expect(name.name(@opt)).to eq('Gearoidin Ui Laighleis')
290
+ expect(name.rname(@opt)).to eq('Ui Laighleis, Gearoidin')
291
+ expect(name.to_s(@opt)).to eq('Ui Laighleis, Gearoidin')
292
292
  name = Name.new('èric PRIÉ')
293
- name.first(@opt).should == 'Eric'
294
- name.last(@opt).should == 'Prie'
293
+ expect(name.first(@opt)).to eq('Eric')
294
+ expect(name.last(@opt)).to eq('Prie')
295
295
  end
296
296
  end
297
297
 
298
298
  context "constuction corner cases" do
299
299
  it "should be handled correctly" do
300
- Name.new('Orr').name.should == 'Orr'
301
- Name.new('Orr').rname.should == 'Orr'
302
- Name.new('Uí Laighléis').rname.should == 'Laighléis, Uí'
303
- Name.new('').name.should == ''
304
- Name.new('').rname.should == ''
305
- Name.new.name.should == ''
306
- Name.new.rname.should == ''
300
+ expect(Name.new('Orr').name).to eq('Orr')
301
+ expect(Name.new('Orr').rname).to eq('Orr')
302
+ expect(Name.new('Uí Laighléis').rname).to eq('Laighléis, Uí')
303
+ expect(Name.new('').name).to eq('')
304
+ expect(Name.new('').rname).to eq('')
305
+ expect(Name.new.name).to eq('')
306
+ expect(Name.new.rname).to eq('')
307
307
  end
308
308
  end
309
309
 
@@ -314,100 +314,100 @@ module ICU
314
314
  end
315
315
 
316
316
  it "should be flexible" do
317
- @mark.match('Mark', 'Orr').should be_true
318
- @mark.match('Mark Orr').should be_true
319
- @mark.match('Orr, Mark').should be_true
320
- @mark.match(@kram).should be_true
317
+ expect(@mark.match('Mark', 'Orr')).to be_truthy
318
+ expect(@mark.match('Mark Orr')).to be_truthy
319
+ expect(@mark.match('Orr, Mark')).to be_truthy
320
+ expect(@mark.match(@kram)).to be_truthy
321
321
  end
322
322
  end
323
323
 
324
324
  context "first name matches" do
325
325
  it "should match when first names are the same" do
326
- Name.new('Mark', 'Orr').match('Mark', 'Orr').should be_true
326
+ expect(Name.new('Mark', 'Orr').match('Mark', 'Orr')).to be_truthy
327
327
  end
328
328
 
329
329
  it "should be flexible with regards to hyphens in double barrelled names" do
330
- Name.new('J.-K.', 'Rowling').match('J. K.', 'Rowling').should be_true
331
- Name.new('Joanne-K.', 'Rowling').match('Joanne K.', 'Rowling').should be_true
332
- Name.new('Èric-K.', 'Cantona').match('Èric K.', 'Cantona').should be_true
330
+ expect(Name.new('J.-K.', 'Rowling').match('J. K.', 'Rowling')).to be_truthy
331
+ expect(Name.new('Joanne-K.', 'Rowling').match('Joanne K.', 'Rowling')).to be_truthy
332
+ expect(Name.new('Èric-K.', 'Cantona').match('Èric K.', 'Cantona')).to be_truthy
333
333
  end
334
334
 
335
335
  it "should match initials" do
336
- Name.new('M. J. L.', 'Orr').match('Mark John Legard', 'Orr').should be_true
337
- Name.new('M.', 'Orr').match('Mark', 'Orr').should be_true
338
- Name.new('M. J. L.', 'Orr').match('Mark', 'Orr').should be_true
339
- Name.new('M.', 'Orr').match('M. J.', 'Orr').should be_true
340
- Name.new('M. J. L.', 'Orr').match('M. G.', 'Orr').should be_false
341
- Name.new('È', 'Cantona').match('Èric K.', 'Cantona').should be_true
342
- Name.new('E. K.', 'Cantona').match('Èric K.', 'Cantona').should be_false
336
+ expect(Name.new('M. J. L.', 'Orr').match('Mark John Legard', 'Orr')).to be_truthy
337
+ expect(Name.new('M.', 'Orr').match('Mark', 'Orr')).to be_truthy
338
+ expect(Name.new('M. J. L.', 'Orr').match('Mark', 'Orr')).to be_truthy
339
+ expect(Name.new('M.', 'Orr').match('M. J.', 'Orr')).to be_truthy
340
+ expect(Name.new('M. J. L.', 'Orr').match('M. G.', 'Orr')).to be_falsey
341
+ expect(Name.new('È', 'Cantona').match('Èric K.', 'Cantona')).to be_truthy
342
+ expect(Name.new('E. K.', 'Cantona').match('Èric K.', 'Cantona')).to be_falsey
343
343
  end
344
344
 
345
345
  it "should not match on full names not in first position or without an exact match" do
346
- Name.new('J. M.', 'Orr').match('John', 'Orr').should be_true
347
- Name.new('M. J.', 'Orr').match('John', 'Orr').should be_false
348
- Name.new('M. John', 'Orr').match('John', 'Orr').should be_true
346
+ expect(Name.new('J. M.', 'Orr').match('John', 'Orr')).to be_truthy
347
+ expect(Name.new('M. J.', 'Orr').match('John', 'Orr')).to be_falsey
348
+ expect(Name.new('M. John', 'Orr').match('John', 'Orr')).to be_truthy
349
349
  end
350
350
 
351
351
  it "should handle common nicknames" do
352
- Name.new('William', 'Orr').match('Bill', 'Orr').should be_true
353
- Name.new('David', 'Orr').match('Dave', 'Orr').should be_true
354
- Name.new('Mick', 'Orr').match('Mike', 'Orr').should be_true
352
+ expect(Name.new('William', 'Orr').match('Bill', 'Orr')).to be_truthy
353
+ expect(Name.new('David', 'Orr').match('Dave', 'Orr')).to be_truthy
354
+ expect(Name.new('Mick', 'Orr').match('Mike', 'Orr')).to be_truthy
355
355
  end
356
356
 
357
357
  it "should handle ambiguous nicknames" do
358
- Name.new('Gerry', 'Orr').match('Gerald', 'Orr').should be_true
359
- Name.new('Gerry', 'Orr').match('Gerard', 'Orr').should be_true
360
- Name.new('Gerard', 'Orr').match('Gerald', 'Orr').should be_false
358
+ expect(Name.new('Gerry', 'Orr').match('Gerald', 'Orr')).to be_truthy
359
+ expect(Name.new('Gerry', 'Orr').match('Gerard', 'Orr')).to be_truthy
360
+ expect(Name.new('Gerard', 'Orr').match('Gerald', 'Orr')).to be_falsey
361
361
  end
362
362
 
363
363
  it "should handle some common misspellings" do
364
- Name.new('Steven', 'Brady').match('Stephen', 'Brady').should be_true
365
- Name.new('Philip', 'Short').match('Phillip', 'Short').should be_true
364
+ expect(Name.new('Steven', 'Brady').match('Stephen', 'Brady')).to be_truthy
365
+ expect(Name.new('Philip', 'Short').match('Phillip', 'Short')).to be_truthy
366
366
  end
367
367
 
368
368
  it "should have some conditional matches" do
369
- Name.new('Sean', 'Bradley').match('John', 'Bradley').should be_true
369
+ expect(Name.new('Sean', 'Bradley').match('John', 'Bradley')).to be_truthy
370
370
  end
371
371
 
372
372
  it "should not mix up nick names" do
373
- Name.new('David', 'Orr').match('Bill', 'Orr').should be_false
373
+ expect(Name.new('David', 'Orr').match('Bill', 'Orr')).to be_falsey
374
374
  end
375
375
  end
376
376
 
377
377
  context "last name matches" do
378
378
  it "should be flexible with regards to hyphens in double barrelled names" do
379
- Name.new('Johanna', "Lowry-O'Reilly").match('Johanna', "Lowry O'Reilly").should be_true
379
+ expect(Name.new('Johanna', "Lowry-O'Reilly").match('Johanna', "Lowry O'Reilly")).to be_truthy
380
380
  end
381
381
 
382
382
  it "should be case insensitive in matches involving Macsomething and MacSomething" do
383
- Name.new('Alan', 'MacDonagh').match('Alan', 'Macdonagh').should be_true
383
+ expect(Name.new('Alan', 'MacDonagh').match('Alan', 'Macdonagh')).to be_truthy
384
384
  end
385
385
 
386
386
  it "should cater for the common mispelling of names beginning with Mc or Mac" do
387
- Name.new('Alan', 'McDonagh').match('Alan', 'MacDonagh').should be_true
388
- Name.new('Darko', 'Polimac').match('Darko', 'Polimc').should be_false
387
+ expect(Name.new('Alan', 'McDonagh').match('Alan', 'MacDonagh')).to be_truthy
388
+ expect(Name.new('Darko', 'Polimac').match('Darko', 'Polimc')).to be_falsey
389
389
  end
390
390
 
391
391
  it "should have some conditional matches" do
392
- Name.new('Debbie', 'Quinn').match('Debbie', 'Benjamin').should be_true
393
- Name.new('Mairead', "O'Siochru").match('Mairead', 'King').should be_true
392
+ expect(Name.new('Debbie', 'Quinn').match('Debbie', 'Benjamin')).to be_truthy
393
+ expect(Name.new('Mairead', "O'Siochru").match('Mairead', 'King')).to be_truthy
394
394
  end
395
395
  end
396
396
 
397
397
  context "matches involving accented characters" do
398
398
  it "should work for identical names" do
399
- Name.new('Gearóidín', 'Uí Laighléis').match('Gearóidín', 'Uí Laighléis').should be_true
400
- Name.new('Gearóidín', 'Uí Laighléis').match('Gearoidin', 'Ui Laighleis').should be_false
399
+ expect(Name.new('Gearóidín', 'Uí Laighléis').match('Gearóidín', 'Uí Laighléis')).to be_truthy
400
+ expect(Name.new('Gearóidín', 'Uí Laighléis').match('Gearoidin', 'Ui Laighleis')).to be_falsey
401
401
  end
402
402
 
403
403
  it "should work for first name initials" do
404
- Name.new('Èric-K.', 'Cantona').match('È. K.', 'Cantona').should be_true
405
- Name.new('Èric-K.', 'Cantona').match('E. K.', 'Cantona').should be_false
404
+ expect(Name.new('Èric-K.', 'Cantona').match('È. K.', 'Cantona')).to be_truthy
405
+ expect(Name.new('Èric-K.', 'Cantona').match('E. K.', 'Cantona')).to be_falsey
406
406
  end
407
407
 
408
408
  it "the matching of accented characters can be relaxed" do
409
- Name.new('Gearóidín', 'Uí Laighléis').match('Gearoidin', 'Ui Laíghleis', :chars => "US-ASCII").should be_true
410
- Name.new('Èric-K.', 'Cantona').match('E. K.', 'Cantona', :chars => "US-ASCII").should be_true
409
+ expect(Name.new('Gearóidín', 'Uí Laighléis').match('Gearoidin', 'Ui Laíghleis', :chars => "US-ASCII")).to be_truthy
410
+ expect(Name.new('Èric-K.', 'Cantona').match('E. K.', 'Cantona', :chars => "US-ASCII")).to be_truthy
411
411
  end
412
412
  end
413
413
 
@@ -421,14 +421,14 @@ module ICU
421
421
  end
422
422
 
423
423
  it "should match some spelling errors" do
424
- Name.new('Steven', 'Brady').match('Stephen', 'Brady').should be_true
425
- Name.new('Philip', 'Short').match('Phillip', 'Short').should be_true
426
- Name.new('Lyubomir', 'Orr').match('Lubomir', 'Orr').should be_true
424
+ expect(Name.new('Steven', 'Brady').match('Stephen', 'Brady')).to be_truthy
425
+ expect(Name.new('Philip', 'Short').match('Phillip', 'Short')).to be_truthy
426
+ expect(Name.new('Lyubomir', 'Orr').match('Lubomir', 'Orr')).to be_truthy
427
427
  end
428
428
 
429
429
  it "should handle conditional matches" do
430
- Name.new('Sean', 'Collins').match('John', 'Collins').should be_false
431
- Name.new('Sean', 'Bradley').match('John', 'Bradley').should be_true
430
+ expect(Name.new('Sean', 'Collins').match('John', 'Collins')).to be_falsey
431
+ expect(Name.new('Sean', 'Bradley').match('John', 'Bradley')).to be_truthy
432
432
  end
433
433
  end
434
434
 
@@ -442,20 +442,20 @@ module ICU
442
442
  end
443
443
 
444
444
  it "should match some spelling errors" do
445
- Name.new('William', 'Ffrench').match('William', 'French').should be_true
445
+ expect(Name.new('William', 'Ffrench').match('William', 'French')).to be_truthy
446
446
  end
447
447
 
448
448
  it "should handle conditional matches" do
449
- Name.new('Mark', 'Quinn').match('Mark', 'Benjamin').should be_false
450
- Name.new('Debbie', 'Quinn').match('Debbie', 'Benjamin').should be_true
451
- Name.new('Oisin', "O'Siochru").match('Oisin', 'King').should be_false
452
- Name.new('Mairead', "O'Siochru").match('Mairead', 'King').should be_true
449
+ expect(Name.new('Mark', 'Quinn').match('Mark', 'Benjamin')).to be_falsey
450
+ expect(Name.new('Debbie', 'Quinn').match('Debbie', 'Benjamin')).to be_truthy
451
+ expect(Name.new('Oisin', "O'Siochru").match('Oisin', 'King')).to be_falsey
452
+ expect(Name.new('Mairead', "O'Siochru").match('Mairead', 'King')).to be_truthy
453
453
  end
454
454
 
455
455
  it "should allow some awesome matches" do
456
- Name.new('debbie quinn').match('Deborah', 'Benjamin').should be_true
457
- Name.new('french, william').match('Bill', 'Ffrench').should be_true
458
- Name.new('Oissine', 'Murphy').match('Oissine', 'Murchadha').should be_true
456
+ expect(Name.new('debbie quinn').match('Deborah', 'Benjamin')).to be_truthy
457
+ expect(Name.new('french, william').match('Bill', 'Ffrench')).to be_truthy
458
+ expect(Name.new('Oissine', 'Murphy').match('Oissine', 'Murchadha')).to be_truthy
459
459
  end
460
460
  end
461
461
 
@@ -469,8 +469,8 @@ module ICU
469
469
  end
470
470
 
471
471
  it "should allow some awesome matches" do
472
- Name.new('french, steven').match('Stephen', 'Ffrench').should be_true
473
- Name.new('Patrick', 'Murphy').match('Padraic', 'Murchadha').should be_true
472
+ expect(Name.new('french, steven').match('Stephen', 'Ffrench')).to be_truthy
473
+ expect(Name.new('Patrick', 'Murphy').match('Padraic', 'Murchadha')).to be_truthy
474
474
  end
475
475
  end
476
476
 
@@ -484,36 +484,36 @@ module ICU
484
484
  end
485
485
 
486
486
  it "should not match after reverting" do
487
- Name.new('avril, demeter').match('Ceres', 'Avril').should be_true
487
+ expect(Name.new('avril, demeter').match('Ceres', 'Avril')).to be_truthy
488
488
  Name.load_alternatives(:first)
489
- Name.new('avril, demeter').match('Ceres', 'Avril').should be_false
490
- Name.new('Patrick', 'Ares').match('Patrick', 'Mars').should be_true
489
+ expect(Name.new('avril, demeter').match('Ceres', 'Avril')).to be_falsey
490
+ expect(Name.new('Patrick', 'Ares').match('Patrick', 'Mars')).to be_truthy
491
491
  Name.load_alternatives(:last)
492
- Name.new('Patrick', 'Ares').match('Patrick', 'Mars').should be_false
492
+ expect(Name.new('Patrick', 'Ares').match('Patrick', 'Mars')).to be_falsey
493
493
  end
494
494
  end
495
495
 
496
496
  context "name alternatives with default configuration" do
497
497
  it "should show common nicknames" do
498
- Name.new('William', 'Ffrench').alternatives(:first).should =~ %w{Bill Willy Willie Will}
499
- Name.new('Bill', 'Ffrench').alternatives(:first).should =~ %w{William Willy Will Willie}
500
- Name.new('Steven', 'Ffrench').alternatives(:first).should =~ %w{Steve Stephen}
501
- Name.new('Stephen', 'Ffrench').alternatives(:first).should =~ %w{Stef Stefan Stefen Stephan Steve Steven}
502
- Name.new('Michael Stephen', 'Ffrench').alternatives(:first).should =~ %w{Micheal Mick Mickie Micky Mike Mikey Stef Stefan Stefen Stephan Steve Steven}
503
- Name.new('Stephen M.', 'Ffrench').alternatives(:first).should =~ %w{Stef Stefan Stefen Stephan Steve Steven}
504
- Name.new('Sean', 'Bradley').alternatives(:first).should =~ %w{John}
505
- Name.new('S.', 'Ffrench').alternatives(:first).should =~ []
498
+ expect(Name.new('William', 'Ffrench').alternatives(:first)).to match_array(%w{Bill Willy Willie Will})
499
+ expect(Name.new('Bill', 'Ffrench').alternatives(:first)).to match_array(%w{William Willy Will Willie})
500
+ expect(Name.new('Steven', 'Ffrench').alternatives(:first)).to match_array(%w{Steve Stephen})
501
+ expect(Name.new('Stephen', 'Ffrench').alternatives(:first)).to match_array(%w{Stef Stefan Stefen Stephan Steve Steven})
502
+ expect(Name.new('Michael Stephen', 'Ffrench').alternatives(:first)).to match_array(%w{Micheal Mick Mickie Micky Mike Mikey Stef Stefan Stefen Stephan Steve Steven})
503
+ expect(Name.new('Stephen M.', 'Ffrench').alternatives(:first)).to match_array(%w{Stef Stefan Stefen Stephan Steve Steven})
504
+ expect(Name.new('Sean', 'Bradley').alternatives(:first)).to match_array(%w{John})
505
+ expect(Name.new('S.', 'Ffrench').alternatives(:first)).to match_array([])
506
506
  end
507
507
 
508
508
  it "should have automatic last name alternatives for apostrophes to cater for FIDE's habits" do
509
- Name.new('Mairead', "O'Siochru").alternatives(:last).should =~ %w{King O`Siochru}
510
- Name.new('Erwin E.', "L`Ami").alternatives(:last).should =~ %w{L`Ami}
509
+ expect(Name.new('Mairead', "O'Siochru").alternatives(:last)).to match_array(%w{King O`Siochru})
510
+ expect(Name.new('Erwin E.', "L`Ami").alternatives(:last)).to match_array(%w{L`Ami})
511
511
  end
512
512
 
513
513
  it "should not have some last name alternatives" do
514
- Name.new('William', 'Ffrench').alternatives(:last).should =~ %w{French}
515
- Name.new('Oissine', 'Murphy').alternatives(:last).should =~ %w{Murchadha}
516
- Name.new('Debbie', 'Quinn').alternatives(:last).should =~ %w{Benjamin}
514
+ expect(Name.new('William', 'Ffrench').alternatives(:last)).to match_array(%w{French})
515
+ expect(Name.new('Oissine', 'Murphy').alternatives(:last)).to match_array(%w{Murchadha})
516
+ expect(Name.new('Debbie', 'Quinn').alternatives(:last)).to match_array(%w{Benjamin})
517
517
  end
518
518
  end
519
519
 
@@ -527,21 +527,21 @@ module ICU
527
527
  end
528
528
 
529
529
  it "should show different nicknames" do
530
- Name.new('Steven', 'Ffrench').alternatives(:first).should =~ %w{Stephen Steve}
531
- Name.new('Stephen', 'Ffrench').alternatives(:first).should =~ %w{Steve Steven}
532
- Name.new('Stephen Mike', 'Ffrench').alternatives(:first).should =~ %w{Michael Steve Steven}
533
- Name.new('Sean', 'Bradley').alternatives(:first).should =~ %w{John}
534
- Name.new('Sean', 'McDonagh').alternatives(:first).should =~ []
535
- Name.new('John', 'Bradley').alternatives(:first).should =~ %w{Sean Johnny}
530
+ expect(Name.new('Steven', 'Ffrench').alternatives(:first)).to match_array(%w{Stephen Steve})
531
+ expect(Name.new('Stephen', 'Ffrench').alternatives(:first)).to match_array(%w{Steve Steven})
532
+ expect(Name.new('Stephen Mike', 'Ffrench').alternatives(:first)).to match_array(%w{Michael Steve Steven})
533
+ expect(Name.new('Sean', 'Bradley').alternatives(:first)).to match_array(%w{John})
534
+ expect(Name.new('Sean', 'McDonagh').alternatives(:first)).to match_array([])
535
+ expect(Name.new('John', 'Bradley').alternatives(:first)).to match_array(%w{Sean Johnny})
536
536
  end
537
537
 
538
538
  it "should have some last name alternatives" do
539
- Name.new('William', 'Ffrench').alternatives(:last).should =~ %w{French}
540
- Name.new('Mairead', "O'Siochru").alternatives(:last).should =~ %w{King O`Siochru}
541
- Name.new('Oissine', 'Murphy').alternatives(:last).should =~ %w{Murchadha}
542
- Name.new('Debbie', 'Quinn').alternatives(:last).should =~ %w{Benjamin}
543
- Name.new('Mark', 'Quinn').alternatives(:last).should =~ []
544
- Name.new('Debbie', 'Quinn-French').alternatives(:last).should =~ %w{Benjamin Ffrench}
539
+ expect(Name.new('William', 'Ffrench').alternatives(:last)).to match_array(%w{French})
540
+ expect(Name.new('Mairead', "O'Siochru").alternatives(:last)).to match_array(%w{King O`Siochru})
541
+ expect(Name.new('Oissine', 'Murphy').alternatives(:last)).to match_array(%w{Murchadha})
542
+ expect(Name.new('Debbie', 'Quinn').alternatives(:last)).to match_array(%w{Benjamin})
543
+ expect(Name.new('Mark', 'Quinn').alternatives(:last)).to match_array([])
544
+ expect(Name.new('Debbie', 'Quinn-French').alternatives(:last)).to match_array(%w{Benjamin Ffrench})
545
545
  end
546
546
  end
547
547
 
@@ -555,20 +555,20 @@ module ICU
555
555
  end
556
556
 
557
557
  it "should be no more than necessary" do
558
- alt_compilations(:first).should == 0
559
- alt_compilations(:last).should == 0
558
+ expect(alt_compilations(:first)).to eq(0)
559
+ expect(alt_compilations(:last)).to eq(0)
560
560
  Name.new('William', 'Ffrench').match('Bill', 'French')
561
- alt_compilations(:first).should == 1
562
- alt_compilations(:last).should == 1
561
+ expect(alt_compilations(:first)).to eq(1)
562
+ expect(alt_compilations(:last)).to eq(1)
563
563
  Name.new('Debbie', 'Quinn').match('Deborah', 'Benjamin')
564
- alt_compilations(:first).should == 1
565
- alt_compilations(:last).should == 1
564
+ expect(alt_compilations(:first)).to eq(1)
565
+ expect(alt_compilations(:last)).to eq(1)
566
566
  load_alt_test(false, :first)
567
- alt_compilations(:first).should == 2
568
- alt_compilations(:last).should == 1
567
+ expect(alt_compilations(:first)).to eq(2)
568
+ expect(alt_compilations(:last)).to eq(1)
569
569
  load_alt_test(false, :last)
570
- alt_compilations(:first).should == 2
571
- alt_compilations(:last).should == 2
570
+ expect(alt_compilations(:first)).to eq(2)
571
+ expect(alt_compilations(:last)).to eq(2)
572
572
  end
573
573
  end
574
574
 
@@ -578,27 +578,27 @@ module ICU
578
578
  end
579
579
 
580
580
  it "there are no setters" do
581
- lambda { @mark.first = "Malcolm" }.should raise_error(/undefined/)
582
- lambda { @mark.last = "Dickie" }.should raise_error(/undefined/)
583
- lambda { @mark.original = "mark orr" }.should raise_error(/undefined/)
581
+ expect { @mark.first = "Malcolm" }.to raise_error(/undefined/)
582
+ expect { @mark.last = "Dickie" }.to raise_error(/undefined/)
583
+ expect { @mark.original = "mark orr" }.to raise_error(/undefined/)
584
584
  end
585
585
 
586
586
  it "should prevent accidentally access to the instance variables" do
587
587
  @mark.first.downcase!
588
- @mark.first.should == "Màrk"
588
+ expect(@mark.first).to eq("Màrk")
589
589
  @mark.last.downcase!
590
- @mark.last.should == "Orr"
590
+ expect(@mark.last).to eq("Orr")
591
591
  @mark.original.downcase!
592
- @mark.original.should == "Orr, Màrk"
592
+ expect(@mark.original).to eq("Orr, Màrk")
593
593
  end
594
594
 
595
595
  it "should prevent accidentally access to the instance variables when transliterating" do
596
596
  @mark.first(:chars => "US-ASCII").downcase!
597
- @mark.first.should == "Màrk"
597
+ expect(@mark.first).to eq("Màrk")
598
598
  @mark.last(:chars => "US-ASCII").downcase!
599
- @mark.last.should == "Orr"
599
+ expect(@mark.last).to eq("Orr")
600
600
  @mark.original(:chars => "US-ASCII").downcase!
601
- @mark.original.should == "Orr, Màrk"
601
+ expect(@mark.original).to eq("Orr, Màrk")
602
602
  end
603
603
  end
604
604
  end
@@ -6,21 +6,21 @@ module ICU
6
6
  describe String do
7
7
  context "#is_utf8" do
8
8
  it "recognises some encodings as a special case of UTF-8" do
9
- expect(String.is_utf8("Resume".encode("US-ASCII"))).to be_true
10
- expect(String.is_utf8("Resume".encode("ASCII-8BIT"))).to be_true
11
- expect(String.is_utf8("Resume".encode("BINARY"))).to be_true
9
+ expect(String.is_utf8("Resume".encode("US-ASCII"))).to be_truthy
10
+ expect(String.is_utf8("Resume".encode("ASCII-8BIT"))).to be_truthy
11
+ expect(String.is_utf8("Resume".encode("BINARY"))).to be_truthy
12
12
  end
13
13
 
14
14
  it "recognises UTF-8" do
15
- expect(String.is_utf8("Résumé")).to be_true
16
- expect(String.is_utf8("δog")).to be_true
15
+ expect(String.is_utf8("Résumé")).to be_truthy
16
+ expect(String.is_utf8("δog")).to be_truthy
17
17
  end
18
18
 
19
19
  it "should recognize other encodings as not being UTF-8" do
20
- expect(String.is_utf8("Résumé".encode("ISO-8859-1"))).to be_false
21
- expect(String.is_utf8("€50".encode("Windows-1252"))).to be_false
22
- expect(String.is_utf8("ひらがな".encode("Shift_JIS"))).to be_false
23
- expect(String.is_utf8("\xa3")).to be_false
20
+ expect(String.is_utf8("Résumé".encode("ISO-8859-1"))).to be_falsey
21
+ expect(String.is_utf8("€50".encode("Windows-1252"))).to be_falsey
22
+ expect(String.is_utf8("ひらがな".encode("Shift_JIS"))).to be_falsey
23
+ expect(String.is_utf8("\xa3")).to be_falsey
24
24
  end
25
25
  end
26
26
 
metadata CHANGED
@@ -1,71 +1,71 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: icu_name
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.3
4
+ version: 1.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Orr
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-15 00:00:00.000000000 Z
11
+ date: 2015-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: '1.8'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: '1.8'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: '10.4'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0'
40
+ version: '10.4'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '0'
47
+ version: '3.2'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '0'
54
+ version: '3.2'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rdoc
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '0'
61
+ version: '4.2'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '0'
68
+ version: '4.2'
69
69
  description: Canonicalises and matches person names with Latin1 characters and first
70
70
  and last names
71
71
  email: mark.j.l.orr@googlemail.com
@@ -75,19 +75,19 @@ extra_rdoc_files:
75
75
  - LICENCE
76
76
  - README.rdoc
77
77
  files:
78
+ - LICENCE
79
+ - README.rdoc
80
+ - config/first_alternatives.yaml
81
+ - config/last_alternatives.yaml
82
+ - config/test_first_alts.yaml
83
+ - config/test_last_alts.yaml
84
+ - lib/icu_name.rb
78
85
  - lib/icu_name/name.rb
79
86
  - lib/icu_name/util.rb
80
87
  - lib/icu_name/version.rb
81
- - lib/icu_name.rb
82
88
  - spec/name_spec.rb
83
89
  - spec/spec_helper.rb
84
90
  - spec/util_spec.rb
85
- - config/first_alternatives.yaml
86
- - config/last_alternatives.yaml
87
- - config/test_first_alts.yaml
88
- - config/test_last_alts.yaml
89
- - LICENCE
90
- - README.rdoc
91
91
  homepage: http://rubygems.org/gems/icu_name
92
92
  licenses:
93
93
  - MIT
@@ -98,17 +98,17 @@ require_paths:
98
98
  - lib
99
99
  required_ruby_version: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - '>='
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
104
  required_rubygems_version: !ruby/object:Gem::Requirement
105
105
  requirements:
106
- - - '>='
106
+ - - ">="
107
107
  - !ruby/object:Gem::Version
108
108
  version: 1.3.6
109
109
  requirements: []
110
110
  rubyforge_project: icu_name
111
- rubygems_version: 2.0.3
111
+ rubygems_version: 2.4.5
112
112
  signing_key:
113
113
  specification_version: 4
114
114
  summary: Canonicalises and matches person names