guard-test 0.2.0 → 0.3.0.rc2
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +1 -1
- data/README.md +128 -0
- data/lib/guard/test.rb +47 -9
- data/lib/guard/test.rbc +761 -157
- data/lib/guard/test/formatter.rbc +215 -91
- data/lib/guard/test/inspector.rb +13 -12
- data/lib/guard/test/inspector.rbc +126 -77
- data/lib/guard/test/notifier.rb +17 -0
- data/lib/guard/test/notifier.rbc +435 -0
- data/lib/guard/test/result_helpers.rb +28 -0
- data/lib/guard/test/result_helpers.rbc +798 -0
- data/lib/guard/test/runner.rb +46 -30
- data/lib/guard/test/runner.rbc +812 -494
- data/lib/guard/test/runners/{default_test_unit_runner.rb → default_guard_test_runner.rb} +19 -15
- data/lib/guard/test/runners/default_guard_test_runner.rbc +1471 -0
- data/lib/guard/test/runners/default_test_unit_runner.rbc +2 -2
- data/lib/guard/test/runners/{fastfail_test_unit_runner.rb → fastfail_guard_test_runner.rb} +11 -7
- data/lib/guard/test/runners/fastfail_guard_test_runner.rbc +614 -0
- data/lib/guard/test/runners/fastfail_test_unit_runner.rbc +1 -1
- data/lib/guard/test/templates/Guardfile +6 -6
- data/lib/guard/test/ui.rb +38 -0
- data/lib/guard/test/ui.rbc +1053 -0
- data/lib/guard/test/version.rb +2 -1
- data/lib/guard/test/version.rbc +6 -6
- metadata +49 -21
- data/README.rdoc +0 -89
- data/lib/guard/test/formatter.rb +0 -68
@@ -1,24 +1,28 @@
|
|
1
|
-
|
1
|
+
# encoding: utf-8
|
2
|
+
require File.expand_path('../default_guard_test_runner', __FILE__)
|
2
3
|
|
3
4
|
# This class is directly inspired by a blog post by Adam Sanderson:
|
4
5
|
# http://endofline.wordpress.com/2008/02/11/a-custom-testrunner-to-scratch-an-itch/
|
5
6
|
# It inherits DefaultGuardTestRunner and redefines only 2 methods in order to display failures
|
6
7
|
# as they happen (the default display them when all the tests are finished).
|
7
|
-
class
|
8
|
+
class FastfailGuardTestRunner < DefaultGuardTestRunner
|
8
9
|
|
9
|
-
private
|
10
|
+
private
|
10
11
|
|
11
12
|
def add_fault(fault)
|
12
13
|
@faults << fault
|
13
14
|
nl
|
14
|
-
|
15
|
-
|
15
|
+
Guard::TestUI.color_print("%3d) %s" % [@faults.size, fault.long_display], :color => fault_color_name(fault))
|
16
|
+
nl
|
16
17
|
end
|
17
18
|
|
18
19
|
def finished(elapsed_time)
|
19
|
-
|
20
|
+
Guard::TestNotifier.notify(@result, elapsed_time) if GUARD_TEST_NOTIFY
|
21
|
+
nl;nl
|
22
|
+
Guard::TestUI.results(@result, elapsed_time)
|
23
|
+
nl
|
20
24
|
end
|
21
25
|
|
22
26
|
end
|
23
27
|
|
24
|
-
Test::Unit::AutoRunner::RUNNERS["guard-fastfail"] = Proc.new { |r|
|
28
|
+
Test::Unit::AutoRunner::RUNNERS["guard-fastfail"] = Proc.new { |r| FastfailGuardTestRunner }
|
@@ -0,0 +1,614 @@
|
|
1
|
+
!RBIX
|
2
|
+
17831730954501249321
|
3
|
+
x
|
4
|
+
M
|
5
|
+
1
|
6
|
+
n
|
7
|
+
n
|
8
|
+
x
|
9
|
+
10
|
10
|
+
__script__
|
11
|
+
i
|
12
|
+
78
|
13
|
+
5
|
14
|
+
45
|
15
|
+
0
|
16
|
+
1
|
17
|
+
7
|
18
|
+
2
|
19
|
+
64
|
20
|
+
65
|
21
|
+
49
|
22
|
+
3
|
23
|
+
0
|
24
|
+
49
|
25
|
+
4
|
26
|
+
2
|
27
|
+
47
|
28
|
+
49
|
29
|
+
5
|
30
|
+
1
|
31
|
+
15
|
32
|
+
99
|
33
|
+
7
|
34
|
+
6
|
35
|
+
45
|
36
|
+
7
|
37
|
+
8
|
38
|
+
65
|
39
|
+
49
|
40
|
+
9
|
41
|
+
3
|
42
|
+
13
|
43
|
+
99
|
44
|
+
12
|
45
|
+
7
|
46
|
+
10
|
47
|
+
12
|
48
|
+
7
|
49
|
+
11
|
50
|
+
12
|
51
|
+
65
|
52
|
+
12
|
53
|
+
49
|
54
|
+
12
|
55
|
+
4
|
56
|
+
15
|
57
|
+
49
|
58
|
+
10
|
59
|
+
0
|
60
|
+
15
|
61
|
+
45
|
62
|
+
13
|
63
|
+
14
|
64
|
+
43
|
65
|
+
15
|
66
|
+
43
|
67
|
+
16
|
68
|
+
43
|
69
|
+
17
|
70
|
+
7
|
71
|
+
18
|
72
|
+
64
|
73
|
+
45
|
74
|
+
19
|
75
|
+
20
|
76
|
+
56
|
77
|
+
21
|
78
|
+
50
|
79
|
+
22
|
80
|
+
0
|
81
|
+
13
|
82
|
+
18
|
83
|
+
3
|
84
|
+
49
|
85
|
+
23
|
86
|
+
2
|
87
|
+
15
|
88
|
+
15
|
89
|
+
2
|
90
|
+
11
|
91
|
+
I
|
92
|
+
6
|
93
|
+
I
|
94
|
+
0
|
95
|
+
I
|
96
|
+
0
|
97
|
+
I
|
98
|
+
0
|
99
|
+
n
|
100
|
+
p
|
101
|
+
24
|
102
|
+
x
|
103
|
+
4
|
104
|
+
File
|
105
|
+
n
|
106
|
+
s
|
107
|
+
28
|
108
|
+
../default_guard_test_runner
|
109
|
+
x
|
110
|
+
11
|
111
|
+
active_path
|
112
|
+
x
|
113
|
+
11
|
114
|
+
expand_path
|
115
|
+
x
|
116
|
+
7
|
117
|
+
require
|
118
|
+
x
|
119
|
+
23
|
120
|
+
FastfailGuardTestRunner
|
121
|
+
x
|
122
|
+
22
|
123
|
+
DefaultGuardTestRunner
|
124
|
+
n
|
125
|
+
x
|
126
|
+
10
|
127
|
+
open_class
|
128
|
+
x
|
129
|
+
14
|
130
|
+
__class_init__
|
131
|
+
M
|
132
|
+
1
|
133
|
+
n
|
134
|
+
n
|
135
|
+
x
|
136
|
+
23
|
137
|
+
FastfailGuardTestRunner
|
138
|
+
i
|
139
|
+
34
|
140
|
+
5
|
141
|
+
66
|
142
|
+
5
|
143
|
+
48
|
144
|
+
0
|
145
|
+
15
|
146
|
+
99
|
147
|
+
7
|
148
|
+
1
|
149
|
+
7
|
150
|
+
2
|
151
|
+
65
|
152
|
+
67
|
153
|
+
49
|
154
|
+
3
|
155
|
+
0
|
156
|
+
49
|
157
|
+
4
|
158
|
+
4
|
159
|
+
15
|
160
|
+
99
|
161
|
+
7
|
162
|
+
5
|
163
|
+
7
|
164
|
+
6
|
165
|
+
65
|
166
|
+
67
|
167
|
+
49
|
168
|
+
3
|
169
|
+
0
|
170
|
+
49
|
171
|
+
4
|
172
|
+
4
|
173
|
+
11
|
174
|
+
I
|
175
|
+
5
|
176
|
+
I
|
177
|
+
0
|
178
|
+
I
|
179
|
+
0
|
180
|
+
I
|
181
|
+
0
|
182
|
+
n
|
183
|
+
p
|
184
|
+
7
|
185
|
+
x
|
186
|
+
7
|
187
|
+
private
|
188
|
+
x
|
189
|
+
9
|
190
|
+
add_fault
|
191
|
+
M
|
192
|
+
1
|
193
|
+
n
|
194
|
+
n
|
195
|
+
x
|
196
|
+
9
|
197
|
+
add_fault
|
198
|
+
i
|
199
|
+
64
|
200
|
+
39
|
201
|
+
0
|
202
|
+
20
|
203
|
+
0
|
204
|
+
49
|
205
|
+
1
|
206
|
+
1
|
207
|
+
15
|
208
|
+
5
|
209
|
+
48
|
210
|
+
2
|
211
|
+
15
|
212
|
+
45
|
213
|
+
3
|
214
|
+
4
|
215
|
+
43
|
216
|
+
5
|
217
|
+
7
|
218
|
+
6
|
219
|
+
64
|
220
|
+
39
|
221
|
+
0
|
222
|
+
49
|
223
|
+
7
|
224
|
+
0
|
225
|
+
20
|
226
|
+
0
|
227
|
+
49
|
228
|
+
8
|
229
|
+
0
|
230
|
+
35
|
231
|
+
2
|
232
|
+
49
|
233
|
+
9
|
234
|
+
1
|
235
|
+
44
|
236
|
+
43
|
237
|
+
10
|
238
|
+
79
|
239
|
+
49
|
240
|
+
11
|
241
|
+
1
|
242
|
+
13
|
243
|
+
7
|
244
|
+
12
|
245
|
+
5
|
246
|
+
20
|
247
|
+
0
|
248
|
+
47
|
249
|
+
49
|
250
|
+
13
|
251
|
+
1
|
252
|
+
49
|
253
|
+
14
|
254
|
+
2
|
255
|
+
15
|
256
|
+
49
|
257
|
+
15
|
258
|
+
2
|
259
|
+
15
|
260
|
+
5
|
261
|
+
48
|
262
|
+
2
|
263
|
+
11
|
264
|
+
I
|
265
|
+
8
|
266
|
+
I
|
267
|
+
1
|
268
|
+
I
|
269
|
+
1
|
270
|
+
I
|
271
|
+
1
|
272
|
+
n
|
273
|
+
p
|
274
|
+
16
|
275
|
+
x
|
276
|
+
7
|
277
|
+
@faults
|
278
|
+
x
|
279
|
+
2
|
280
|
+
<<
|
281
|
+
x
|
282
|
+
2
|
283
|
+
nl
|
284
|
+
x
|
285
|
+
5
|
286
|
+
Guard
|
287
|
+
n
|
288
|
+
x
|
289
|
+
6
|
290
|
+
TestUI
|
291
|
+
s
|
292
|
+
7
|
293
|
+
%3d) %s
|
294
|
+
x
|
295
|
+
4
|
296
|
+
size
|
297
|
+
x
|
298
|
+
12
|
299
|
+
long_display
|
300
|
+
x
|
301
|
+
1
|
302
|
+
%
|
303
|
+
x
|
304
|
+
4
|
305
|
+
Hash
|
306
|
+
x
|
307
|
+
16
|
308
|
+
new_from_literal
|
309
|
+
x
|
310
|
+
5
|
311
|
+
color
|
312
|
+
x
|
313
|
+
16
|
314
|
+
fault_color_name
|
315
|
+
x
|
316
|
+
3
|
317
|
+
[]=
|
318
|
+
x
|
319
|
+
11
|
320
|
+
color_print
|
321
|
+
p
|
322
|
+
11
|
323
|
+
I
|
324
|
+
-1
|
325
|
+
I
|
326
|
+
c
|
327
|
+
I
|
328
|
+
0
|
329
|
+
I
|
330
|
+
d
|
331
|
+
I
|
332
|
+
8
|
333
|
+
I
|
334
|
+
e
|
335
|
+
I
|
336
|
+
c
|
337
|
+
I
|
338
|
+
f
|
339
|
+
I
|
340
|
+
3c
|
341
|
+
I
|
342
|
+
10
|
343
|
+
I
|
344
|
+
40
|
345
|
+
x
|
346
|
+
103
|
347
|
+
/Users/remy/Development/Ruby/Gems/guard/guard-test/lib/guard/test/runners/fastfail_guard_test_runner.rb
|
348
|
+
p
|
349
|
+
1
|
350
|
+
x
|
351
|
+
5
|
352
|
+
fault
|
353
|
+
x
|
354
|
+
17
|
355
|
+
method_visibility
|
356
|
+
x
|
357
|
+
15
|
358
|
+
add_defn_method
|
359
|
+
x
|
360
|
+
8
|
361
|
+
finished
|
362
|
+
M
|
363
|
+
1
|
364
|
+
n
|
365
|
+
n
|
366
|
+
x
|
367
|
+
8
|
368
|
+
finished
|
369
|
+
i
|
370
|
+
46
|
371
|
+
45
|
372
|
+
0
|
373
|
+
1
|
374
|
+
9
|
375
|
+
19
|
376
|
+
45
|
377
|
+
2
|
378
|
+
3
|
379
|
+
43
|
380
|
+
4
|
381
|
+
39
|
382
|
+
5
|
383
|
+
20
|
384
|
+
0
|
385
|
+
49
|
386
|
+
6
|
387
|
+
2
|
388
|
+
8
|
389
|
+
20
|
390
|
+
1
|
391
|
+
15
|
392
|
+
5
|
393
|
+
48
|
394
|
+
7
|
395
|
+
15
|
396
|
+
5
|
397
|
+
48
|
398
|
+
7
|
399
|
+
15
|
400
|
+
45
|
401
|
+
2
|
402
|
+
8
|
403
|
+
43
|
404
|
+
9
|
405
|
+
39
|
406
|
+
5
|
407
|
+
20
|
408
|
+
0
|
409
|
+
49
|
410
|
+
10
|
411
|
+
2
|
412
|
+
15
|
413
|
+
5
|
414
|
+
48
|
415
|
+
7
|
416
|
+
11
|
417
|
+
I
|
418
|
+
4
|
419
|
+
I
|
420
|
+
1
|
421
|
+
I
|
422
|
+
1
|
423
|
+
I
|
424
|
+
1
|
425
|
+
n
|
426
|
+
p
|
427
|
+
11
|
428
|
+
x
|
429
|
+
17
|
430
|
+
GUARD_TEST_NOTIFY
|
431
|
+
n
|
432
|
+
x
|
433
|
+
5
|
434
|
+
Guard
|
435
|
+
n
|
436
|
+
x
|
437
|
+
12
|
438
|
+
TestNotifier
|
439
|
+
x
|
440
|
+
7
|
441
|
+
@result
|
442
|
+
x
|
443
|
+
6
|
444
|
+
notify
|
445
|
+
x
|
446
|
+
2
|
447
|
+
nl
|
448
|
+
n
|
449
|
+
x
|
450
|
+
6
|
451
|
+
TestUI
|
452
|
+
x
|
453
|
+
7
|
454
|
+
results
|
455
|
+
p
|
456
|
+
13
|
457
|
+
I
|
458
|
+
-1
|
459
|
+
I
|
460
|
+
13
|
461
|
+
I
|
462
|
+
0
|
463
|
+
I
|
464
|
+
14
|
465
|
+
I
|
466
|
+
14
|
467
|
+
I
|
468
|
+
0
|
469
|
+
I
|
470
|
+
15
|
471
|
+
I
|
472
|
+
15
|
473
|
+
I
|
474
|
+
1d
|
475
|
+
I
|
476
|
+
16
|
477
|
+
I
|
478
|
+
2a
|
479
|
+
I
|
480
|
+
17
|
481
|
+
I
|
482
|
+
2e
|
483
|
+
x
|
484
|
+
103
|
485
|
+
/Users/remy/Development/Ruby/Gems/guard/guard-test/lib/guard/test/runners/fastfail_guard_test_runner.rb
|
486
|
+
p
|
487
|
+
1
|
488
|
+
x
|
489
|
+
12
|
490
|
+
elapsed_time
|
491
|
+
p
|
492
|
+
7
|
493
|
+
I
|
494
|
+
2
|
495
|
+
I
|
496
|
+
a
|
497
|
+
I
|
498
|
+
6
|
499
|
+
I
|
500
|
+
c
|
501
|
+
I
|
502
|
+
14
|
503
|
+
I
|
504
|
+
13
|
505
|
+
I
|
506
|
+
22
|
507
|
+
x
|
508
|
+
103
|
509
|
+
/Users/remy/Development/Ruby/Gems/guard/guard-test/lib/guard/test/runners/fastfail_guard_test_runner.rb
|
510
|
+
p
|
511
|
+
0
|
512
|
+
x
|
513
|
+
13
|
514
|
+
attach_method
|
515
|
+
x
|
516
|
+
4
|
517
|
+
Test
|
518
|
+
n
|
519
|
+
x
|
520
|
+
4
|
521
|
+
Unit
|
522
|
+
x
|
523
|
+
10
|
524
|
+
AutoRunner
|
525
|
+
x
|
526
|
+
7
|
527
|
+
RUNNERS
|
528
|
+
s
|
529
|
+
14
|
530
|
+
guard-fastfail
|
531
|
+
x
|
532
|
+
4
|
533
|
+
Proc
|
534
|
+
n
|
535
|
+
M
|
536
|
+
1
|
537
|
+
p
|
538
|
+
2
|
539
|
+
x
|
540
|
+
9
|
541
|
+
for_block
|
542
|
+
t
|
543
|
+
n
|
544
|
+
x
|
545
|
+
9
|
546
|
+
__block__
|
547
|
+
i
|
548
|
+
8
|
549
|
+
57
|
550
|
+
19
|
551
|
+
0
|
552
|
+
15
|
553
|
+
45
|
554
|
+
0
|
555
|
+
1
|
556
|
+
11
|
557
|
+
I
|
558
|
+
3
|
559
|
+
I
|
560
|
+
1
|
561
|
+
I
|
562
|
+
1
|
563
|
+
I
|
564
|
+
1
|
565
|
+
n
|
566
|
+
p
|
567
|
+
2
|
568
|
+
x
|
569
|
+
23
|
570
|
+
FastfailGuardTestRunner
|
571
|
+
n
|
572
|
+
p
|
573
|
+
3
|
574
|
+
I
|
575
|
+
0
|
576
|
+
I
|
577
|
+
1c
|
578
|
+
I
|
579
|
+
8
|
580
|
+
x
|
581
|
+
103
|
582
|
+
/Users/remy/Development/Ruby/Gems/guard/guard-test/lib/guard/test/runners/fastfail_guard_test_runner.rb
|
583
|
+
p
|
584
|
+
1
|
585
|
+
x
|
586
|
+
1
|
587
|
+
r
|
588
|
+
x
|
589
|
+
3
|
590
|
+
new
|
591
|
+
x
|
592
|
+
3
|
593
|
+
[]=
|
594
|
+
p
|
595
|
+
7
|
596
|
+
I
|
597
|
+
0
|
598
|
+
I
|
599
|
+
2
|
600
|
+
I
|
601
|
+
13
|
602
|
+
I
|
603
|
+
8
|
604
|
+
I
|
605
|
+
30
|
606
|
+
I
|
607
|
+
1c
|
608
|
+
I
|
609
|
+
4e
|
610
|
+
x
|
611
|
+
103
|
612
|
+
/Users/remy/Development/Ruby/Gems/guard/guard-test/lib/guard/test/runners/fastfail_guard_test_runner.rb
|
613
|
+
p
|
614
|
+
0
|