guard-rspec 0.1.9 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2010 Thibaud Guillaume-Gentil
1
+ Copyright (c) 2011 Thibaud Guillaume-Gentil
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.rdoc CHANGED
@@ -2,16 +2,16 @@
2
2
 
3
3
  RSpec guard allows to automatically & intelligently launch specs when files are modified.
4
4
 
5
- - Compatible with RSpec 1.x & RSpec 2.x
6
- - Tested on Ruby 1.8.6, 1.8.7 & 1.9.2.
5
+ - Compatible with RSpec 1.x & RSpec 2.x (>= 2.4 needed for notification formatter)
6
+ - Tested on Ruby 1.8.6, 1.8.7, 1.9.2, JRuby & Rubinius.
7
7
 
8
8
  == Install
9
9
 
10
- Please be sure to have {guard}[http://github.com/guard/guard] installed before continue.
10
+ Please be sure to have {Guard}[https://github.com/guard/guard] installed before continue.
11
11
 
12
12
  Install the gem:
13
13
 
14
- gem install guard-rspec
14
+ $ gem install guard-rspec
15
15
 
16
16
  Add it to your Gemfile (inside test group):
17
17
 
@@ -19,66 +19,88 @@ Add it to your Gemfile (inside test group):
19
19
 
20
20
  Add guard definition to your Guardfile by running this command:
21
21
 
22
- guard init rspec
22
+ $ guard init rspec
23
23
 
24
24
  == Usage
25
25
 
26
- Please read {guard usage doc}[http://github.com/guard/guard#readme]
26
+ Please read {Guard usage doc}[https://github.com/guard/guard#readme]
27
27
 
28
28
  == Guardfile
29
29
 
30
- RSpec guard can be really be adapated to all kind of projects.
31
- Please read {guard doc}[http://github.com/guard/guard#readme] for more info about Guardfile DSL.
30
+ RSpec guard can be really adapted to all kind of projects.
32
31
 
33
- === Standard ruby gems
32
+ === Standard RubyGem project
34
33
 
35
34
  guard 'rspec' do
36
- watch('^spec/(.*)_spec.rb')
37
- watch('^lib/(.*)\.rb') { |m| "spec/lib/#{m[1]}_spec.rb" }
38
- watch('^spec/spec_helper.rb') { "spec" }
35
+ watch(%r{^spec/.+_spec\.rb})
36
+ watch(%r{^lib/(.+)\.rb}) { |m| "spec/lib/#{m[1]}_spec.rb" }
37
+ watch('spec/spec_helper.rb') { "spec" }
39
38
  end
40
39
 
41
- === Rails app
40
+ === Typical Rails app
42
41
 
43
42
  guard 'rspec' do
44
- watch('^spec/(.*)_spec.rb')
45
- watch('^app/(.*)\.rb') { |m| "spec/#{m[1]}_spec.rb" }
46
- watch('^lib/(.*)\.rb') { |m| "spec/lib/#{m[1]}_spec.rb" }
47
- watch('^spec/spec_helper.rb') { "spec" }
48
- watch('^config/routes.rb') { "spec/routing" }
49
- watch('^app/controllers/application_controller.rb') { "spec/controllers" }
50
- watch('^spec/factories.rb') { "spec/models" }
43
+ watch('spec/spec_helper.rb') { "spec" }
44
+ watch('config/routes.rb') { "spec/routing" }
45
+ watch('app/controllers/application_controller.rb') { "spec/controllers" }
46
+ watch(%r{^spec/.+_spec\.rb})
47
+ watch(%r{^app/(.+)\.rb}) { |m| "spec/#{m[1]}_spec.rb" }
48
+ watch(%r{^lib/(.+)\.rb}) { |m| "spec/lib/#{m[1]}_spec.rb" }
49
+ watch(%r{^app/controllers/(.+)_(controller)\.rb}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] }
51
50
  end
52
51
 
52
+ Please read {Guard doc}[https://github.com/guard/guard#readme] for more information about the Guardfile DSL.
53
+
53
54
  == Options
54
55
 
55
- RSpec guard should automatically detect RSpec version (via spec_helper syntax or Bundler) but you can force version with:
56
+ By default, Guard::RSpec automatically detect your RSpec version (with the <tt>spec_helper.rb</tt> syntax or with Bundler) but you can force the version with the <tt>:version</tt> option:
56
57
 
57
58
  guard 'rspec', :version => 2 do
58
59
  ...
59
60
  end
60
-
61
- Other available options:
62
61
 
63
- :color => false
64
- :drb => true
65
- :bundler => false # don't use "bundle exec"
66
- :rvm => ['1.8.7', '1.9.2'] # directly run your specs on multiple ruby
67
- :formatter => "instafail" # show failing specs instantly
68
- :fail_fast => true # RSpec 2.1+ only
62
+ You can pass any of the standard RSpec CLI options using the <tt>:cli</tt> option:
63
+
64
+ guard 'rspec', :cli => "--color --format nested --fail-fast --drb" do
65
+ ...
66
+ end
67
+
68
+ Former <tt>:color</tt>, <tt>:drb</tt>, <tt>:fail_fast</tt> and <tt>:formatter</tt> options are thus deprecated and have no effect anymore.
69
+
70
+ === List of available options:
71
+
72
+ :version => 1 # force use RSpec version 1, default: 2
73
+ :cli => "-c -f doc" # pass arbitrary RSpec CLI arguments, default: "-f progress"
74
+ :bundler => false # don't use "bundle exec" to run the RSpec command, default: true
75
+ :rvm => ['1.8.7', '1.9.2'] # directly run your specs on multiple Rubies, default: nil
76
+ :notification => false # don't display Growl (or Libnotify) notification after the specs are done running, default: true
77
+
78
+ == Formatters
79
+
80
+ The <tt>:formatter</tt> option has been removed since CLI arguments can be passed through the <tt>:cli</tt> option. If you want to use the former Instafail formatter, you need to use <tt>rspec-instafail</tt> gem instead:
81
+
82
+ # in your Gemfile
83
+ gem 'rspec-instafail'
84
+
85
+ # in your Guardfile
86
+ guard 'rspec, :cli => "-r rspec/instafail -f RSpec::Instafail" do
87
+ ...
88
+ end
89
+
90
+ Default formatter is the <tt>progress</tt> formatter (same as RSpec default).
69
91
 
70
92
  == Development
71
93
 
72
- - Source hosted at {GitHub}[http://github.com/guard/guard-rspec]
73
- - Report issues/Questions/Feature requests on {GitHub Issues}[http://github.com/guard/guard-rspec/issues]
94
+ - Source hosted at {GitHub}[https://github.com/guard/guard-rspec]
95
+ - Report issues/Questions/Feature requests on {GitHub Issues}[https://github.com/guard/guard-rspec/issues]
74
96
 
75
97
  Pull requests are very welcome! Make sure your patches are well tested. Please create a topic branch for every separate change
76
98
  you make.
77
99
 
78
100
  === Testing
79
101
 
80
- Please run "rake spec:prepare_fixtures" once before launching specs.
102
+ Please run <tt>rake spec:prepare_fixtures</tt> once before launching specs.
81
103
 
82
104
  == Authors
83
105
 
84
- {Thibaud Guillaume-Gentil}[http://github.com/thibaudgg]
106
+ {Thibaud Guillaume-Gentil}[https://github.com/thibaudgg]
data/lib/guard/rspec.rb CHANGED
@@ -3,23 +3,24 @@ require 'guard/guard'
3
3
 
4
4
  module Guard
5
5
  class RSpec < Guard
6
-
7
- autoload :Runner, 'guard/rspec/runner'
6
+
7
+ autoload :Runner, 'guard/rspec/runner'
8
8
  autoload :Inspector, 'guard/rspec/inspector'
9
-
10
- def initialize(watchers = [], options = {})
9
+
10
+ def initialize(watchers=[], options={})
11
11
  super
12
+ UI.info "Guard::RSpec is running!"
12
13
  Runner.set_rspec_version(options)
13
14
  end
14
-
15
+
15
16
  def run_all
16
- Runner.run ["spec"], options.merge(:message => "Running all specs")
17
+ Runner.run(["spec"], options.merge(:message => "Running all specs"))
17
18
  end
18
-
19
+
19
20
  def run_on_change(paths)
20
21
  paths = Inspector.clean(paths)
21
22
  Runner.run(paths, options) unless paths.empty?
22
23
  end
23
-
24
+
24
25
  end
25
26
  end
@@ -0,0 +1,659 @@
1
+ !RBIX
2
+ 10937318184790222022
3
+ x
4
+ M
5
+ 1
6
+ n
7
+ n
8
+ x
9
+ 10
10
+ __script__
11
+ i
12
+ 46
13
+ 5
14
+ 7
15
+ 0
16
+ 64
17
+ 47
18
+ 49
19
+ 1
20
+ 1
21
+ 15
22
+ 5
23
+ 7
24
+ 2
25
+ 64
26
+ 47
27
+ 49
28
+ 1
29
+ 1
30
+ 15
31
+ 99
32
+ 7
33
+ 3
34
+ 65
35
+ 49
36
+ 4
37
+ 2
38
+ 13
39
+ 99
40
+ 12
41
+ 7
42
+ 5
43
+ 12
44
+ 7
45
+ 6
46
+ 12
47
+ 65
48
+ 12
49
+ 49
50
+ 7
51
+ 4
52
+ 15
53
+ 49
54
+ 5
55
+ 0
56
+ 15
57
+ 2
58
+ 11
59
+ I
60
+ 6
61
+ I
62
+ 0
63
+ I
64
+ 0
65
+ I
66
+ 0
67
+ n
68
+ p
69
+ 8
70
+ s
71
+ 5
72
+ guard
73
+ x
74
+ 7
75
+ require
76
+ s
77
+ 11
78
+ guard/guard
79
+ x
80
+ 5
81
+ Guard
82
+ x
83
+ 11
84
+ open_module
85
+ x
86
+ 15
87
+ __module_init__
88
+ M
89
+ 1
90
+ n
91
+ n
92
+ x
93
+ 5
94
+ Guard
95
+ i
96
+ 31
97
+ 5
98
+ 66
99
+ 99
100
+ 7
101
+ 0
102
+ 45
103
+ 1
104
+ 2
105
+ 65
106
+ 49
107
+ 3
108
+ 3
109
+ 13
110
+ 99
111
+ 12
112
+ 7
113
+ 4
114
+ 12
115
+ 7
116
+ 5
117
+ 12
118
+ 65
119
+ 12
120
+ 49
121
+ 6
122
+ 4
123
+ 15
124
+ 49
125
+ 4
126
+ 0
127
+ 11
128
+ I
129
+ 6
130
+ I
131
+ 0
132
+ I
133
+ 0
134
+ I
135
+ 0
136
+ n
137
+ p
138
+ 7
139
+ x
140
+ 5
141
+ RSpec
142
+ x
143
+ 5
144
+ Guard
145
+ n
146
+ x
147
+ 10
148
+ open_class
149
+ x
150
+ 14
151
+ __class_init__
152
+ M
153
+ 1
154
+ n
155
+ n
156
+ x
157
+ 5
158
+ RSpec
159
+ i
160
+ 66
161
+ 5
162
+ 66
163
+ 5
164
+ 7
165
+ 0
166
+ 7
167
+ 1
168
+ 64
169
+ 47
170
+ 49
171
+ 2
172
+ 2
173
+ 15
174
+ 5
175
+ 7
176
+ 3
177
+ 7
178
+ 4
179
+ 64
180
+ 47
181
+ 49
182
+ 2
183
+ 2
184
+ 15
185
+ 99
186
+ 7
187
+ 5
188
+ 7
189
+ 6
190
+ 65
191
+ 67
192
+ 49
193
+ 7
194
+ 0
195
+ 49
196
+ 8
197
+ 4
198
+ 15
199
+ 99
200
+ 7
201
+ 9
202
+ 7
203
+ 10
204
+ 65
205
+ 67
206
+ 49
207
+ 7
208
+ 0
209
+ 49
210
+ 8
211
+ 4
212
+ 15
213
+ 99
214
+ 7
215
+ 11
216
+ 7
217
+ 12
218
+ 65
219
+ 67
220
+ 49
221
+ 7
222
+ 0
223
+ 49
224
+ 8
225
+ 4
226
+ 11
227
+ I
228
+ 5
229
+ I
230
+ 0
231
+ I
232
+ 0
233
+ I
234
+ 0
235
+ n
236
+ p
237
+ 13
238
+ x
239
+ 6
240
+ Runner
241
+ s
242
+ 18
243
+ guard/rspec/runner
244
+ x
245
+ 8
246
+ autoload
247
+ x
248
+ 9
249
+ Inspector
250
+ s
251
+ 21
252
+ guard/rspec/inspector
253
+ x
254
+ 10
255
+ initialize
256
+ M
257
+ 1
258
+ n
259
+ n
260
+ x
261
+ 10
262
+ initialize
263
+ i
264
+ 46
265
+ 23
266
+ 0
267
+ 10
268
+ 9
269
+ 35
270
+ 0
271
+ 19
272
+ 0
273
+ 15
274
+ 23
275
+ 1
276
+ 10
277
+ 23
278
+ 44
279
+ 43
280
+ 0
281
+ 78
282
+ 49
283
+ 1
284
+ 1
285
+ 19
286
+ 1
287
+ 15
288
+ 54
289
+ 89
290
+ 2
291
+ 15
292
+ 45
293
+ 3
294
+ 4
295
+ 7
296
+ 5
297
+ 64
298
+ 49
299
+ 6
300
+ 1
301
+ 15
302
+ 45
303
+ 7
304
+ 8
305
+ 20
306
+ 1
307
+ 49
308
+ 9
309
+ 1
310
+ 11
311
+ I
312
+ 4
313
+ I
314
+ 2
315
+ I
316
+ 0
317
+ I
318
+ 2
319
+ n
320
+ p
321
+ 10
322
+ x
323
+ 4
324
+ Hash
325
+ x
326
+ 16
327
+ new_from_literal
328
+ x
329
+ 10
330
+ initialize
331
+ x
332
+ 2
333
+ UI
334
+ n
335
+ s
336
+ 24
337
+ Guard::RSpec is running!
338
+ x
339
+ 4
340
+ info
341
+ x
342
+ 6
343
+ Runner
344
+ n
345
+ x
346
+ 17
347
+ set_rspec_version
348
+ p
349
+ 9
350
+ I
351
+ -1
352
+ I
353
+ a
354
+ I
355
+ 17
356
+ I
357
+ b
358
+ I
359
+ 1b
360
+ I
361
+ c
362
+ I
363
+ 25
364
+ I
365
+ d
366
+ I
367
+ 2e
368
+ x
369
+ 62
370
+ /Users/Thibaud/Development/Code/guard-rspec/lib/guard/rspec.rb
371
+ p
372
+ 2
373
+ x
374
+ 8
375
+ watchers
376
+ x
377
+ 7
378
+ options
379
+ x
380
+ 17
381
+ method_visibility
382
+ x
383
+ 15
384
+ add_defn_method
385
+ x
386
+ 7
387
+ run_all
388
+ M
389
+ 1
390
+ n
391
+ n
392
+ x
393
+ 7
394
+ run_all
395
+ i
396
+ 35
397
+ 45
398
+ 0
399
+ 1
400
+ 7
401
+ 2
402
+ 64
403
+ 35
404
+ 1
405
+ 5
406
+ 48
407
+ 3
408
+ 44
409
+ 43
410
+ 4
411
+ 79
412
+ 49
413
+ 5
414
+ 1
415
+ 13
416
+ 7
417
+ 6
418
+ 7
419
+ 7
420
+ 64
421
+ 49
422
+ 8
423
+ 2
424
+ 15
425
+ 49
426
+ 9
427
+ 1
428
+ 49
429
+ 10
430
+ 2
431
+ 11
432
+ I
433
+ 7
434
+ I
435
+ 0
436
+ I
437
+ 0
438
+ I
439
+ 0
440
+ n
441
+ p
442
+ 11
443
+ x
444
+ 6
445
+ Runner
446
+ n
447
+ s
448
+ 4
449
+ spec
450
+ x
451
+ 7
452
+ options
453
+ x
454
+ 4
455
+ Hash
456
+ x
457
+ 16
458
+ new_from_literal
459
+ x
460
+ 7
461
+ message
462
+ s
463
+ 17
464
+ Running all specs
465
+ x
466
+ 3
467
+ []=
468
+ x
469
+ 5
470
+ merge
471
+ x
472
+ 3
473
+ run
474
+ p
475
+ 5
476
+ I
477
+ -1
478
+ I
479
+ 10
480
+ I
481
+ 0
482
+ I
483
+ 11
484
+ I
485
+ 23
486
+ x
487
+ 62
488
+ /Users/Thibaud/Development/Code/guard-rspec/lib/guard/rspec.rb
489
+ p
490
+ 0
491
+ x
492
+ 13
493
+ run_on_change
494
+ M
495
+ 1
496
+ n
497
+ n
498
+ x
499
+ 13
500
+ run_on_change
501
+ i
502
+ 33
503
+ 45
504
+ 0
505
+ 1
506
+ 20
507
+ 0
508
+ 49
509
+ 2
510
+ 1
511
+ 19
512
+ 0
513
+ 15
514
+ 20
515
+ 0
516
+ 49
517
+ 3
518
+ 0
519
+ 9
520
+ 21
521
+ 1
522
+ 8
523
+ 32
524
+ 45
525
+ 4
526
+ 5
527
+ 20
528
+ 0
529
+ 5
530
+ 48
531
+ 6
532
+ 49
533
+ 7
534
+ 2
535
+ 11
536
+ I
537
+ 4
538
+ I
539
+ 1
540
+ I
541
+ 1
542
+ I
543
+ 1
544
+ n
545
+ p
546
+ 8
547
+ x
548
+ 9
549
+ Inspector
550
+ n
551
+ x
552
+ 5
553
+ clean
554
+ x
555
+ 6
556
+ empty?
557
+ x
558
+ 6
559
+ Runner
560
+ n
561
+ x
562
+ 7
563
+ options
564
+ x
565
+ 3
566
+ run
567
+ p
568
+ 7
569
+ I
570
+ -1
571
+ I
572
+ 14
573
+ I
574
+ 0
575
+ I
576
+ 15
577
+ I
578
+ b
579
+ I
580
+ 16
581
+ I
582
+ 21
583
+ x
584
+ 62
585
+ /Users/Thibaud/Development/Code/guard-rspec/lib/guard/rspec.rb
586
+ p
587
+ 1
588
+ x
589
+ 5
590
+ paths
591
+ p
592
+ 11
593
+ I
594
+ 2
595
+ I
596
+ 7
597
+ I
598
+ d
599
+ I
600
+ 8
601
+ I
602
+ 18
603
+ I
604
+ a
605
+ I
606
+ 26
607
+ I
608
+ 10
609
+ I
610
+ 34
611
+ I
612
+ 14
613
+ I
614
+ 42
615
+ x
616
+ 62
617
+ /Users/Thibaud/Development/Code/guard-rspec/lib/guard/rspec.rb
618
+ p
619
+ 0
620
+ x
621
+ 13
622
+ attach_method
623
+ p
624
+ 3
625
+ I
626
+ 2
627
+ I
628
+ 5
629
+ I
630
+ 1f
631
+ x
632
+ 62
633
+ /Users/Thibaud/Development/Code/guard-rspec/lib/guard/rspec.rb
634
+ p
635
+ 0
636
+ x
637
+ 13
638
+ attach_method
639
+ p
640
+ 7
641
+ I
642
+ 0
643
+ I
644
+ 1
645
+ I
646
+ 9
647
+ I
648
+ 2
649
+ I
650
+ 12
651
+ I
652
+ 4
653
+ I
654
+ 2e
655
+ x
656
+ 62
657
+ /Users/Thibaud/Development/Code/guard-rspec/lib/guard/rspec.rb
658
+ p
659
+ 0