Package: ruby-filepath / 0.6-3

0004-RSpec3.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
Description: Add basic RSpec3 support
Author: Cédric Boutillier <boutil@debian.org>
Bug-Debian: https://bugs.debian.org/795037
Forwarded: https://github.com/gioele/filepath/pull/3
Last-Update: 2015-08-13

--- a/spec/filepath_spec.rb
+++ b/spec/filepath_spec.rb
@@ -182,7 +182,7 @@
 		]
 		with_extension.each do |path|
 			it "says that <#{path}> has an extension" do
-				FilePath.new(path).extension?.should be_true
+				FilePath.new(path).extension?.should be true
 			end
 		end
 
@@ -193,7 +193,7 @@
 		]
 		no_extension.each do |path|
 			it "says that <#{path}> has no extension" do
-				FilePath.new(path).extension?.should be_false
+				FilePath.new(path).extension?.should be false
 			end
 		end
 
@@ -205,12 +205,12 @@
 		]
 		extension_data.each do |path, ext|
 			it "says that <#{path}> extesions is #{ext.inspect}" do
-				FilePath.new(path).extension?(ext).should be_true
+				FilePath.new(path).extension?(ext).should be true
 			end
 		end
 
 		it "says that `foo.bar` extension is not `baz`" do
-			FilePath.new('foo.bar').extension?('baz').should be_false
+			FilePath.new('foo.bar').extension?('baz').should be false
 		end
 	end
 
@@ -320,7 +320,7 @@
 				steps << seg
 			end
 
-			steps.should have(4).items
+			steps.size.should eq(4)
 			steps[0].should eq("/")
 			steps[1].should eq("a")
 			steps[2].should eq("b")
@@ -333,7 +333,7 @@
 				steps << seg
 			end
 
-			steps.should have(3).items
+			steps.size.should eq(3)
 			steps[0].should eq("a")
 			steps[1].should eq("b")
 			steps[2].should eq("c")
@@ -352,7 +352,7 @@
 				steps << seg
 			end
 
-			steps.should have(4).items
+			steps.size.should eq(4)
 			steps[0].should eq("/a/b/c")
 			steps[1].should eq("/a/b")
 			steps[2].should eq("/a")
@@ -365,7 +365,7 @@
 				steps << seg
 			end
 
-			steps.should have(3).items
+			steps.size.should eq(3)
 			steps[0].should eq("a/b/c")
 			steps[1].should eq("a/b")
 			steps[2].should eq("a")
@@ -384,7 +384,7 @@
 				steps << seg
 			end
 
-			steps.should have(4).items
+			steps.size.should eq(4)
 			steps[0].should eq("/")
 			steps[1].should eq("/a")
 			steps[2].should eq("/a/b")
@@ -397,7 +397,7 @@
 				steps << seg
 			end
 
-			steps.should have(3).items
+			steps.size.should eq(3)
 			steps[0].should eq("a")
 			steps[1].should eq("a/b")
 			steps[2].should eq("a/b/c")
@@ -801,7 +801,7 @@
 				ph.open('w') { |file| file << lines.join("\n") }
 				readlines = ph.readlines
 
-				readlines.should have(3).lines
+				readlines.size.should eq(3)
 				readlines.all? { |l| l.chomp.should == line }
 			end
 
@@ -811,7 +811,7 @@
 				ph.open('w') { |file| file << lines.join(sep) }
 				readlines = ph.readlines(sep)
 
-				readlines.should have(3).lines
+				readlines.size.should eq(3)
 				readlines[0..-2].all? { |l| l.should == line + sep}
 				readlines.last.should == line
 			end
@@ -964,68 +964,68 @@
 			it "finds all paths matching a glob string" do
 				list = @root.find('*1')
 
-				list.should have(8).items
+				list.size.should eq(8)
 				list.each { |path| path.should =~ /1/ }
 			end
 
 			it "finds all paths matching a Regex" do
 				list = @root.find(/2/)
 
-				list.should have(6).items
+				list.size.should eq(6)
 				list.each { |path| path.should =~ /2/ }
 			end
 
 			it "finds all paths for which the block returns true" do
 				list = @root.find { |path| path.directory? }
 
-				list.should have(9).items
+				list.size.should eq(9)
 				list.each { |path| path.filename.should =~ /^d/ }
 			end
 		end
 
 		describe "#files" do
 			it "finds 1 file in the root directory" do
-				@root.files.should have(1).item
+				@root.files.size.should eq(1)
 			end
 
 			it "finds 3 files in the root directory and its sub directories" do
-				@root.files(true).should have(3).item
+				@root.files(true).size.should eq(3)
 			end
 
 			it "finds 2 files in directory <d1>" do
-				(@root / 'd1').files.should have(2).items
+				(@root / 'd1').files.size.should eq(2)
 			end
 
 			it "finds no files in directory <d1/d12>" do
-				(@root / 'd1' / 'd12').files.should have(0).items
+				(@root / 'd1' / 'd12').files.size.should eq(0)
 			end
 		end
 
 		describe "#directories" do
 			it "finds 4 directories in the root directory" do
-				@root.directories.should have(4).items
+				@root.directories.size.should eq(4)
 			end
 
 			it "finds 9 directories in the root directory and its sub directories" do
-				@root.directories(true).should have(9).item
+				@root.directories(true).size.should eq(9)
 			end
 
 			it "finds 2 directories in directory <d2>" do
-				(@root / 'd2').directories.should have(2).items
+				(@root / 'd2').directories.size.should eq(2)
 			end
 
 			it "finds no directories in directory <d1/d13>" do
-				(@root / 'd1' / 'd13').directories.should have(0).items
+				(@root / 'd1' / 'd13').directories.size.should eq(0)
 			end
 		end
 
 		describe "#links" do
 			it "finds no links in the root directory" do
-				@root.links.should have(0).items
+				@root.links.size.should be(0)
 			end
 
 			it "finds 1 link in directory <d1>" do
-				(@root / 'd1').links.should have(1).item
+				(@root / 'd1').links.size.should eq(1)
 			end
 		end
 	end
--- a/spec/filepathlist_spec.rb
+++ b/spec/filepathlist_spec.rb
@@ -14,7 +14,7 @@
 			paths = %w{a/b c/d e/f}
 			list = FilePathList.new(paths)
 
-			list.should have(3).items
+			list.size.should eq(3)
 			list.each { |path| path.should be_a(FilePath) }
 		end
 
@@ -22,7 +22,7 @@
 			paths = %w{a/b c/d e/f}.map(&:as_path)
 			list = FilePathList.new(paths)
 
-			list.should have(3).items
+			list.size.should eq(3)
 			list.each { |path| path.should be_a(FilePath) }
 		end
 
@@ -30,7 +30,7 @@
 			paths = [%w{a b}, %w{c d}, %w{e f}]
 			list = FilePathList.new(paths)
 
-			list.should have(3).items
+			list.size.should eq(3)
 			list.each { |path| path.should be_a(FilePath) }
 		end
 	end
@@ -49,7 +49,7 @@
 			list2 = FilePathList.new(%w{d e})
 
 			list = list1 + list2
-			list.should have(5).items
+			list.size.should eq(5)
 			list[0].should eq('a')
 			list[1].should eq('b')
 			list[2].should eq('c')
@@ -63,7 +63,7 @@
 			list1 = FilePathList.new(%w{a/b /a/c e/d})
 			list2 = list1 - %w{a/b e/d}
 
-			list2.should have(1).item
+			list2.size.should eq(1)
 			list2[0].should eq('/a/c')
 		end
 	end
@@ -73,8 +73,8 @@
 			list1 = FilePathList.new(%w{a/b /c/d})
 			list2 = list1 << "e/f"
 
-			list1.should have(2).items
-			list2.should have(3).items
+			list1.size.should eq(2)
+			list2.size.should eq(3)
 
 			list2[0].should eq('a/b')
 			list2[1].should eq('/c/d')
@@ -93,7 +93,7 @@
 				all_paths = p1.product(p2).map { |x| x.join('/') }
 
 				list = list1 * list2
-				list.should have(6).items
+				list.size.should eq(6)
 				list.should include(*all_paths)
 			end
 
@@ -102,7 +102,7 @@
 				p2 = "abc"
 
 				list = FilePathList.new(p1) * p2
-				list.should have(3).items
+				list.size.should eq(3)
 				list.should include(*%w{a/abc b/abc c/abc})
 			end
 
@@ -111,7 +111,7 @@
 				p2 = FilePath.new("x")
 
 				list = FilePathList.new(p1) * p2
-				list.should have(3).items
+				list.size.should eq(3)
 				list.should include(*%w{a/x b/x c/x})
 			end
 
@@ -120,7 +120,7 @@
 				p2 = ["1", "2"]
 
 				list = FilePathList.new(p1) * p2
-				list.should have(6).items
+				list.size.should eq(6)
 				list.should include(*%w{a/1 b/1 a/2 b/2 c/1 c/2})
 			end
 		end
@@ -131,7 +131,7 @@
 			paths = %w{a/b/x1 a/b/x2 a/b/x3}
 			list = FilePathList.new(paths).remove_common_segments
 
-			list.should have(3).items
+			list.size.should eq(3)
 			list.should include(*%w{x1 x2 x3})
 		end
 
@@ -139,7 +139,7 @@
 			list1 = FilePathList.new(%w{a/b/x1 a/b/c/x2 a/b/d/e/x3})
 			list2 = list1.remove_common_segments
 
-			list2.should have(3).items
+			list2.size.should eq(3)
 			list2.should include(*%w{x1 c/x2 d/e/x3})
 		end
 
@@ -197,21 +197,21 @@
 		describe "#all?" do
 			it "checks whether a block applies to a list" do
 				ok = list.all? { |path| path.extension? }
-				ok.should be_true
+				ok.should be true
 			end
 		end
 
 		describe "#any?" do
 			it "check whether a block does not apply to any path" do
 				ok = list.any? { |path| path.basename == "a.foo" }
-				ok.should be_true
+				ok.should be true
 			end
 		end
 
 		describe "#none?" do
 			it "check whether a block does not apply to any path" do
 				ok = list.none? { |path| path.absolute? }
-				ok.should be_true
+				ok.should be true
 			end
 		end
 	end
@@ -224,14 +224,14 @@
 				remaining = list.select(/bar$/)
 
 				remaining.should be_a FilePathList
-				remaining.should have(2).items
+				remaining.size.should eq(2)
 				remaining.each { |path| path.extension.should == 'bar' }
 			end
 
 			it "keeps all the paths for which the block returns true" do
 				remaining = list.select { |ph| ph.extension?('bar') }
 
-				remaining.should have(2).items
+				remaining.size.should eq(2)
 				remaining.each { |ph| ph.extension.should == 'bar' }
 			end
 		end
@@ -241,7 +241,7 @@
 				remaining = list.exclude(/bar$/)
 
 				remaining.should be_a FilePathList
-				remaining.should have(3).items
+				remaining.size.should eq(3)
 				remaining.each { |path| path.extension.should == 'foo' }
 			end
 
@@ -249,7 +249,7 @@
 				remaining = list.exclude { |path| path.extension?('bar') }
 
 				remaining.should be_a FilePathList
-				remaining.should have(3).items
+				remaining.size.should eq(3)
 				remaining.each { |path| path.extension.should == 'foo' }
 			end
 		end
@@ -259,8 +259,8 @@
 				mapped = list.map { |path| path.remove_extension }
 
 				mapped.should be_a FilePathList
-				mapped.should have(list.size).items
-				mapped.each { |path| path.extension?.should be_false }
+				mapped.size.should eq(list.size)
+				mapped.each { |path| path.extension?.should be false }
 			end
 		end
 	end