guard-cucumber 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md CHANGED
@@ -1,11 +1,14 @@
1
1
  # Guard::Cucumber
2
2
 
3
+ ![travis-ci](http://travis-ci.org/netzpirat/guard-cucumber.png)
4
+
3
5
  Guard::Cucumber allows you to automatically run Cucumber features when files are modified.
4
- It is tested on Ruby 1.8.7 & 1.9.2.
6
+
7
+ Tested on MRI Ruby 1.8.6, 1.8.7, 1.9.2 and the latest versions of JRuby & Rubinius.
5
8
 
6
9
  ## Install
7
10
 
8
- Please be sure to have [Guard](http://github.com/guard/guard) installed before continue.
11
+ Please be sure to have [Guard](https://github.com/guard/guard) installed before continue.
9
12
 
10
13
  Install the gem:
11
14
 
@@ -21,7 +24,7 @@ Add the default Guard::Cucumber template to your `Guardfile` by running this com
21
24
 
22
25
  ## Usage
23
26
 
24
- Please read the [Guard usage documentation](http://github.com/guard/guard#readme).
27
+ Please read the [Guard usage documentation](https://github.com/guard/guard#readme).
25
28
 
26
29
  ## Guardfile
27
30
 
@@ -59,11 +62,23 @@ Former `:color`, `:drb`, `:port` and `:profile` options are thus deprecated and
59
62
  :bundler => false # Don't use "bundle exec" to run the Cucumber command, default: true
60
63
  :rvm => ['1.8.7', '1.9.2'] # Directly run your features on multiple ruby versions, default: nil
61
64
  :notification => false # Don't display Growl (or Libnotify) notification, default: true
65
+ :all_after_pass => false # don't run all features after changed features pass, default: true
66
+ :all_on_start => false # don't run all the features at startup, default: true
67
+ :keep_failed => false # keep failed features until them pass, default: true
68
+
69
+ ## Spork configuration
70
+
71
+ To use Guard::Cucumber with [Spork](https://github.com/timcharper/spork) (preferabbly managed through
72
+ [Guard::Spork](https://github.com/guard/guard-spork)), you'll want to use the following configuration:
73
+
74
+ guard 'cucumber', :cli => '--drb --require features/support --require features/step_definitions' do
75
+ ...
76
+ end
62
77
 
63
78
  ## Development
64
79
 
65
- - Source hosted at [GitHub](http://github.com/netzpirat/guard-cucumber)
66
- - Report issues/Questions/Feature requests on [GitHub Issues](http://github.com/netzpirat/guard-cucumber/issues)
80
+ - Source hosted at [GitHub](https://github.com/netzpirat/guard-cucumber)
81
+ - Report issues/Questions/Feature requests on [GitHub Issues](https://github.com/netzpirat/guard-cucumber/issues)
67
82
 
68
83
  Pull requests are very welcome! Make sure your patches are well tested.
69
84
 
@@ -71,6 +86,13 @@ Pull requests are very welcome! Make sure your patches are well tested.
71
86
 
72
87
  * [Oriol Gual](https://github.com/oriolgual)
73
88
  * [Aleksei Gusev](https://github.com/hron)
89
+ * [Loren Norman](https://github.com/lorennorman)
90
+
91
+ Since guard-cucumber is very close to guard-rspec, some contributions by the following authors have been
92
+ incorporated into guard-cucumber:
93
+
94
+ * [Andre Arko](https://github.com/indirect)
95
+ * [Thibaud Guillaume-Gentil](https://github.com/thibaudgg)
74
96
 
75
97
  ## Acknowledgment
76
98
 
@@ -5,29 +5,52 @@ require 'cucumber'
5
5
  module Guard
6
6
  class Cucumber < Guard
7
7
 
8
- # Need to be an absolute path for the preload runner
9
- autoload :Runner, File.expand_path(File.join(File.dirname(__FILE__), 'cucumber', 'runners', 'runner'))
10
- autoload :PreloadRunner, File.expand_path(File.join(File.dirname(__FILE__), 'cucumber', 'runners', 'preload_runner'))
11
- autoload :Inspector, File.expand_path(File.join(File.dirname(__FILE__), 'cucumber', 'inspector'))
8
+ autoload :Runner, 'guard/cucumber/runner'
9
+ autoload :Inspector, 'guard/cucumber/inspector'
10
+
11
+ def initialize(watchers=[], options={})
12
+ super
13
+ @options = {
14
+ :all_after_pass => true,
15
+ :all_on_start => true,
16
+ :keep_failed => true
17
+ }.update(options)
18
+
19
+ @last_failed = false
20
+ @failed_paths = []
21
+ end
12
22
 
13
23
  def start
14
- PreloadRunner.start if options[:preload]
24
+ run_all if @options[:all_on_start]
15
25
  end
16
26
 
17
27
  def run_all
18
- runner.run ['features'], options.merge!({ :message => 'Run all Cucumber features' })
19
- end
28
+ passed = Runner.run(['features'], options.merge({ :message => 'Running all features' }))
20
29
 
21
- def run_on_change(paths)
22
- paths = Inspector.clean(paths)
23
- options.merge!({ :message => 'Run all Cucumber features' }) if paths.include?('features')
24
- runner.run(paths, options) unless paths.empty?
30
+ @failed_paths = [] if passed
31
+ @last_failed = !passed
25
32
  end
26
33
 
27
- private
34
+ def reload
35
+ @failed_paths = []
36
+ end
28
37
 
29
- def runner
30
- options[:preload] ? PreloadRunner : Runner
38
+ def run_on_change(paths)
39
+ paths += @failed_paths if @options[:keep_failed]
40
+ paths = Inspector.clean(paths)
41
+ passed = Runner.run(paths, paths.include?('features') ? options.merge({ :message => 'Running all features' }) : options)
42
+
43
+ if passed
44
+ # clean failed paths memory
45
+ @failed_paths -= paths if @options[:keep_failed]
46
+ # run all the specs if the changed specs failed, like autotest
47
+ run_all if @last_failed && @options[:all_after_pass]
48
+ else
49
+ # remember failed paths for the next change
50
+ @failed_paths += paths if @options[:keep_failed]
51
+ # track whether the changed feature failed for the next change
52
+ @last_failed = true
53
+ end
31
54
  end
32
55
 
33
56
  end
@@ -0,0 +1,925 @@
1
+ !RBIX
2
+ 333337424968067900
3
+ x
4
+ M
5
+ 1
6
+ n
7
+ n
8
+ x
9
+ 10
10
+ __script__
11
+ i
12
+ 55
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
+ 5
32
+ 7
33
+ 3
34
+ 64
35
+ 47
36
+ 49
37
+ 1
38
+ 1
39
+ 15
40
+ 99
41
+ 7
42
+ 4
43
+ 65
44
+ 49
45
+ 5
46
+ 2
47
+ 13
48
+ 99
49
+ 12
50
+ 7
51
+ 6
52
+ 12
53
+ 7
54
+ 7
55
+ 12
56
+ 65
57
+ 12
58
+ 49
59
+ 8
60
+ 4
61
+ 15
62
+ 49
63
+ 6
64
+ 0
65
+ 15
66
+ 2
67
+ 11
68
+ I
69
+ 6
70
+ I
71
+ 0
72
+ I
73
+ 0
74
+ I
75
+ 0
76
+ n
77
+ p
78
+ 9
79
+ s
80
+ 5
81
+ guard
82
+ x
83
+ 7
84
+ require
85
+ s
86
+ 11
87
+ guard/guard
88
+ s
89
+ 8
90
+ cucumber
91
+ x
92
+ 5
93
+ Guard
94
+ x
95
+ 11
96
+ open_module
97
+ x
98
+ 15
99
+ __module_init__
100
+ M
101
+ 1
102
+ n
103
+ n
104
+ x
105
+ 5
106
+ Guard
107
+ i
108
+ 31
109
+ 5
110
+ 66
111
+ 99
112
+ 7
113
+ 0
114
+ 45
115
+ 1
116
+ 2
117
+ 65
118
+ 49
119
+ 3
120
+ 3
121
+ 13
122
+ 99
123
+ 12
124
+ 7
125
+ 4
126
+ 12
127
+ 7
128
+ 5
129
+ 12
130
+ 65
131
+ 12
132
+ 49
133
+ 6
134
+ 4
135
+ 15
136
+ 49
137
+ 4
138
+ 0
139
+ 11
140
+ I
141
+ 6
142
+ I
143
+ 0
144
+ I
145
+ 0
146
+ I
147
+ 0
148
+ n
149
+ p
150
+ 7
151
+ x
152
+ 8
153
+ Cucumber
154
+ x
155
+ 5
156
+ Guard
157
+ n
158
+ x
159
+ 10
160
+ open_class
161
+ x
162
+ 14
163
+ __class_init__
164
+ M
165
+ 1
166
+ n
167
+ n
168
+ x
169
+ 8
170
+ Cucumber
171
+ i
172
+ 176
173
+ 5
174
+ 66
175
+ 5
176
+ 7
177
+ 0
178
+ 45
179
+ 1
180
+ 2
181
+ 45
182
+ 1
183
+ 3
184
+ 45
185
+ 1
186
+ 4
187
+ 65
188
+ 49
189
+ 5
190
+ 0
191
+ 49
192
+ 6
193
+ 1
194
+ 7
195
+ 7
196
+ 64
197
+ 7
198
+ 8
199
+ 64
200
+ 7
201
+ 9
202
+ 64
203
+ 49
204
+ 10
205
+ 4
206
+ 49
207
+ 11
208
+ 1
209
+ 47
210
+ 49
211
+ 12
212
+ 2
213
+ 15
214
+ 5
215
+ 7
216
+ 13
217
+ 45
218
+ 1
219
+ 14
220
+ 45
221
+ 1
222
+ 15
223
+ 45
224
+ 1
225
+ 16
226
+ 65
227
+ 49
228
+ 5
229
+ 0
230
+ 49
231
+ 6
232
+ 1
233
+ 7
234
+ 7
235
+ 64
236
+ 7
237
+ 8
238
+ 64
239
+ 7
240
+ 17
241
+ 64
242
+ 49
243
+ 10
244
+ 4
245
+ 49
246
+ 11
247
+ 1
248
+ 47
249
+ 49
250
+ 12
251
+ 2
252
+ 15
253
+ 5
254
+ 7
255
+ 18
256
+ 45
257
+ 1
258
+ 19
259
+ 45
260
+ 1
261
+ 20
262
+ 45
263
+ 1
264
+ 21
265
+ 65
266
+ 49
267
+ 5
268
+ 0
269
+ 49
270
+ 6
271
+ 1
272
+ 7
273
+ 7
274
+ 64
275
+ 7
276
+ 22
277
+ 64
278
+ 49
279
+ 10
280
+ 3
281
+ 49
282
+ 11
283
+ 1
284
+ 47
285
+ 49
286
+ 12
287
+ 2
288
+ 15
289
+ 99
290
+ 7
291
+ 23
292
+ 7
293
+ 24
294
+ 65
295
+ 67
296
+ 49
297
+ 25
298
+ 0
299
+ 49
300
+ 26
301
+ 4
302
+ 15
303
+ 99
304
+ 7
305
+ 27
306
+ 7
307
+ 28
308
+ 65
309
+ 67
310
+ 49
311
+ 25
312
+ 0
313
+ 49
314
+ 26
315
+ 4
316
+ 15
317
+ 99
318
+ 7
319
+ 29
320
+ 7
321
+ 30
322
+ 65
323
+ 67
324
+ 49
325
+ 25
326
+ 0
327
+ 49
328
+ 26
329
+ 4
330
+ 15
331
+ 5
332
+ 48
333
+ 31
334
+ 15
335
+ 99
336
+ 7
337
+ 32
338
+ 7
339
+ 33
340
+ 65
341
+ 67
342
+ 49
343
+ 25
344
+ 0
345
+ 49
346
+ 26
347
+ 4
348
+ 11
349
+ I
350
+ 8
351
+ I
352
+ 0
353
+ I
354
+ 0
355
+ I
356
+ 0
357
+ n
358
+ p
359
+ 34
360
+ x
361
+ 6
362
+ Runner
363
+ x
364
+ 4
365
+ File
366
+ n
367
+ n
368
+ n
369
+ x
370
+ 11
371
+ active_path
372
+ x
373
+ 7
374
+ dirname
375
+ s
376
+ 8
377
+ cucumber
378
+ s
379
+ 7
380
+ runners
381
+ s
382
+ 6
383
+ runner
384
+ x
385
+ 4
386
+ join
387
+ x
388
+ 11
389
+ expand_path
390
+ x
391
+ 8
392
+ autoload
393
+ x
394
+ 13
395
+ PreloadRunner
396
+ n
397
+ n
398
+ n
399
+ s
400
+ 14
401
+ preload_runner
402
+ x
403
+ 9
404
+ Inspector
405
+ n
406
+ n
407
+ n
408
+ s
409
+ 9
410
+ inspector
411
+ x
412
+ 5
413
+ start
414
+ M
415
+ 1
416
+ n
417
+ n
418
+ x
419
+ 5
420
+ start
421
+ i
422
+ 20
423
+ 5
424
+ 48
425
+ 0
426
+ 7
427
+ 1
428
+ 49
429
+ 2
430
+ 1
431
+ 9
432
+ 18
433
+ 45
434
+ 3
435
+ 4
436
+ 49
437
+ 5
438
+ 0
439
+ 8
440
+ 19
441
+ 1
442
+ 11
443
+ I
444
+ 2
445
+ I
446
+ 0
447
+ I
448
+ 0
449
+ I
450
+ 0
451
+ n
452
+ p
453
+ 6
454
+ x
455
+ 7
456
+ options
457
+ x
458
+ 7
459
+ preload
460
+ x
461
+ 2
462
+ []
463
+ x
464
+ 13
465
+ PreloadRunner
466
+ n
467
+ x
468
+ 5
469
+ start
470
+ p
471
+ 5
472
+ I
473
+ -1
474
+ I
475
+ d
476
+ I
477
+ 0
478
+ I
479
+ e
480
+ I
481
+ 14
482
+ x
483
+ 62
484
+ /Users/michi/Repositories/guard-cucumber/lib/guard/cucumber.rb
485
+ p
486
+ 0
487
+ x
488
+ 17
489
+ method_visibility
490
+ x
491
+ 15
492
+ add_defn_method
493
+ x
494
+ 7
495
+ run_all
496
+ M
497
+ 1
498
+ n
499
+ n
500
+ x
501
+ 7
502
+ run_all
503
+ i
504
+ 35
505
+ 5
506
+ 48
507
+ 0
508
+ 7
509
+ 1
510
+ 64
511
+ 35
512
+ 1
513
+ 5
514
+ 48
515
+ 2
516
+ 44
517
+ 43
518
+ 3
519
+ 79
520
+ 49
521
+ 4
522
+ 1
523
+ 13
524
+ 7
525
+ 5
526
+ 7
527
+ 6
528
+ 64
529
+ 49
530
+ 7
531
+ 2
532
+ 15
533
+ 49
534
+ 8
535
+ 1
536
+ 49
537
+ 9
538
+ 2
539
+ 11
540
+ I
541
+ 7
542
+ I
543
+ 0
544
+ I
545
+ 0
546
+ I
547
+ 0
548
+ n
549
+ p
550
+ 10
551
+ x
552
+ 6
553
+ runner
554
+ s
555
+ 8
556
+ features
557
+ x
558
+ 7
559
+ options
560
+ x
561
+ 4
562
+ Hash
563
+ x
564
+ 16
565
+ new_from_literal
566
+ x
567
+ 7
568
+ message
569
+ s
570
+ 25
571
+ Run all Cucumber features
572
+ x
573
+ 3
574
+ []=
575
+ x
576
+ 6
577
+ merge!
578
+ x
579
+ 3
580
+ run
581
+ p
582
+ 5
583
+ I
584
+ -1
585
+ I
586
+ 11
587
+ I
588
+ 0
589
+ I
590
+ 12
591
+ I
592
+ 23
593
+ x
594
+ 62
595
+ /Users/michi/Repositories/guard-cucumber/lib/guard/cucumber.rb
596
+ p
597
+ 0
598
+ x
599
+ 13
600
+ run_on_change
601
+ M
602
+ 1
603
+ n
604
+ n
605
+ x
606
+ 13
607
+ run_on_change
608
+ i
609
+ 70
610
+ 45
611
+ 0
612
+ 1
613
+ 20
614
+ 0
615
+ 49
616
+ 2
617
+ 1
618
+ 19
619
+ 0
620
+ 15
621
+ 20
622
+ 0
623
+ 7
624
+ 3
625
+ 64
626
+ 49
627
+ 4
628
+ 1
629
+ 9
630
+ 46
631
+ 5
632
+ 48
633
+ 5
634
+ 44
635
+ 43
636
+ 6
637
+ 79
638
+ 49
639
+ 7
640
+ 1
641
+ 13
642
+ 7
643
+ 8
644
+ 7
645
+ 9
646
+ 64
647
+ 49
648
+ 10
649
+ 2
650
+ 15
651
+ 49
652
+ 11
653
+ 1
654
+ 8
655
+ 47
656
+ 1
657
+ 15
658
+ 20
659
+ 0
660
+ 49
661
+ 12
662
+ 0
663
+ 9
664
+ 58
665
+ 1
666
+ 8
667
+ 69
668
+ 5
669
+ 48
670
+ 13
671
+ 20
672
+ 0
673
+ 5
674
+ 48
675
+ 5
676
+ 49
677
+ 14
678
+ 2
679
+ 11
680
+ I
681
+ 6
682
+ I
683
+ 1
684
+ I
685
+ 1
686
+ I
687
+ 1
688
+ n
689
+ p
690
+ 15
691
+ x
692
+ 9
693
+ Inspector
694
+ n
695
+ x
696
+ 5
697
+ clean
698
+ s
699
+ 8
700
+ features
701
+ x
702
+ 8
703
+ include?
704
+ x
705
+ 7
706
+ options
707
+ x
708
+ 4
709
+ Hash
710
+ x
711
+ 16
712
+ new_from_literal
713
+ x
714
+ 7
715
+ message
716
+ s
717
+ 25
718
+ Run all Cucumber features
719
+ x
720
+ 3
721
+ []=
722
+ x
723
+ 6
724
+ merge!
725
+ x
726
+ 6
727
+ empty?
728
+ x
729
+ 6
730
+ runner
731
+ x
732
+ 3
733
+ run
734
+ p
735
+ 9
736
+ I
737
+ -1
738
+ I
739
+ 15
740
+ I
741
+ 0
742
+ I
743
+ 16
744
+ I
745
+ b
746
+ I
747
+ 17
748
+ I
749
+ 30
750
+ I
751
+ 18
752
+ I
753
+ 46
754
+ x
755
+ 62
756
+ /Users/michi/Repositories/guard-cucumber/lib/guard/cucumber.rb
757
+ p
758
+ 1
759
+ x
760
+ 5
761
+ paths
762
+ x
763
+ 7
764
+ private
765
+ x
766
+ 6
767
+ runner
768
+ M
769
+ 1
770
+ n
771
+ n
772
+ x
773
+ 6
774
+ runner
775
+ i
776
+ 19
777
+ 5
778
+ 48
779
+ 0
780
+ 7
781
+ 1
782
+ 49
783
+ 2
784
+ 1
785
+ 9
786
+ 15
787
+ 45
788
+ 3
789
+ 4
790
+ 8
791
+ 18
792
+ 45
793
+ 5
794
+ 6
795
+ 11
796
+ I
797
+ 2
798
+ I
799
+ 0
800
+ I
801
+ 0
802
+ I
803
+ 0
804
+ n
805
+ p
806
+ 7
807
+ x
808
+ 7
809
+ options
810
+ x
811
+ 7
812
+ preload
813
+ x
814
+ 2
815
+ []
816
+ x
817
+ 13
818
+ PreloadRunner
819
+ n
820
+ x
821
+ 6
822
+ Runner
823
+ n
824
+ p
825
+ 5
826
+ I
827
+ -1
828
+ I
829
+ 1d
830
+ I
831
+ 0
832
+ I
833
+ 1e
834
+ I
835
+ 13
836
+ x
837
+ 62
838
+ /Users/michi/Repositories/guard-cucumber/lib/guard/cucumber.rb
839
+ p
840
+ 0
841
+ p
842
+ 17
843
+ I
844
+ 2
845
+ I
846
+ 9
847
+ I
848
+ 29
849
+ I
850
+ a
851
+ I
852
+ 50
853
+ I
854
+ b
855
+ I
856
+ 74
857
+ I
858
+ d
859
+ I
860
+ 82
861
+ I
862
+ 11
863
+ I
864
+ 90
865
+ I
866
+ 15
867
+ I
868
+ 9e
869
+ I
870
+ 1b
871
+ I
872
+ a2
873
+ I
874
+ 1d
875
+ I
876
+ b0
877
+ x
878
+ 62
879
+ /Users/michi/Repositories/guard-cucumber/lib/guard/cucumber.rb
880
+ p
881
+ 0
882
+ x
883
+ 13
884
+ attach_method
885
+ p
886
+ 3
887
+ I
888
+ 2
889
+ I
890
+ 6
891
+ I
892
+ 1f
893
+ x
894
+ 62
895
+ /Users/michi/Repositories/guard-cucumber/lib/guard/cucumber.rb
896
+ p
897
+ 0
898
+ x
899
+ 13
900
+ attach_method
901
+ p
902
+ 9
903
+ I
904
+ 0
905
+ I
906
+ 1
907
+ I
908
+ 9
909
+ I
910
+ 2
911
+ I
912
+ 12
913
+ I
914
+ 3
915
+ I
916
+ 1b
917
+ I
918
+ 5
919
+ I
920
+ 37
921
+ x
922
+ 62
923
+ /Users/michi/Repositories/guard-cucumber/lib/guard/cucumber.rb
924
+ p
925
+ 0