guard-test 0.3.0.rc4 → 0.3.0.rc5

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
@@ -86,21 +86,11 @@ Available options:
86
86
  :bundler => false # don't use "bundle exec" to run the test command, default: true if a you have a Gemfile
87
87
  :runner => 'fastfail' # default: 'default'
88
88
  :cli => "-v" # pass arbitrary CLI arguments to the Ruby command that runs the tests, default: nil
89
- :notification => false # don't display Growl (or Libnotify) notification after the specs are done running, default: true
90
89
  :all_on_start => false # don't run all the tests at startup, default: true
91
90
  :all_after_pass => false # don't run all tests after changed tests pass, default: true
92
91
  :keep_failed => false # keep failed tests until them pass, default: true
93
92
  ```
94
93
 
95
- ### Note about the `:notification` option
96
-
97
- If you don't want to use Growl or Libnotify with any of your guards, you can set a `GUARD_NOTIFY` environment variable to `false`.
98
- You can do it by adding the following statement in you `.bashrc`/`.bash_profile`/`.zshrc`:
99
-
100
- ```bash
101
- export GUARD_NOTIFY=false
102
- ```
103
-
104
94
  ## Development
105
95
 
106
96
  - Source hosted on GitHub: https://github.com/guard/guard-test
@@ -7,22 +7,23 @@ module Guard
7
7
  def clean(paths)
8
8
  paths.uniq!
9
9
  paths.compact!
10
- paths = paths.select { |p| test_file?(p) || test_folder?(p) }
11
10
 
12
11
  paths.dup.each do |path|
13
- if File.directory?(path)
12
+ if test_folder?(path)
14
13
  paths.delete(path)
15
- paths += Dir.glob("#{path}/**/*_test.rb")
14
+ paths += Dir.glob("#{path}/**/test_*.rb") + Dir.glob("#{path}/**/*_test.rb")
15
+ else
16
+ paths.delete(path) unless test_file?(path)
16
17
  end
17
18
  end
18
19
 
19
20
  paths.uniq!
20
21
  paths.compact!
21
22
  clear_test_files_list
22
- paths.sort
23
+ paths.sort - ['test/test_helper.rb']
23
24
  end
24
25
 
25
- private
26
+ private
26
27
 
27
28
  def test_folder?(path)
28
29
  path.match(/^\/?test/) && !path.match(/\..+$/) && File.directory?(path)
@@ -339,7 +339,7 @@ x
339
339
  5
340
340
  clean
341
341
  i
342
- 55
342
+ 52
343
343
  20
344
344
  0
345
345
  49
@@ -354,23 +354,13 @@ i
354
354
  15
355
355
  20
356
356
  0
357
- 56
358
- 2
359
- 50
360
- 3
361
- 0
362
- 19
363
- 0
364
- 15
365
- 20
366
- 0
367
357
  49
368
- 4
358
+ 2
369
359
  0
370
360
  56
371
- 5
361
+ 3
372
362
  50
373
- 6
363
+ 4
374
364
  0
375
365
  15
376
366
  20
@@ -387,13 +377,20 @@ i
387
377
  15
388
378
  5
389
379
  48
390
- 7
380
+ 5
391
381
  15
392
382
  20
393
383
  0
394
384
  49
395
- 8
385
+ 6
396
386
  0
387
+ 7
388
+ 7
389
+ 64
390
+ 35
391
+ 1
392
+ 82
393
+ 8
397
394
  11
398
395
  I
399
396
  3
@@ -412,79 +409,6 @@ uniq!
412
409
  x
413
410
  8
414
411
  compact!
415
- M
416
- 1
417
- p
418
- 2
419
- x
420
- 9
421
- for_block
422
- t
423
- n
424
- x
425
- 5
426
- clean
427
- i
428
- 23
429
- 57
430
- 19
431
- 0
432
- 15
433
- 5
434
- 20
435
- 0
436
- 47
437
- 49
438
- 0
439
- 1
440
- 13
441
- 10
442
- 22
443
- 15
444
- 5
445
- 20
446
- 0
447
- 47
448
- 49
449
- 1
450
- 1
451
- 11
452
- I
453
- 4
454
- I
455
- 1
456
- I
457
- 1
458
- I
459
- 1
460
- n
461
- p
462
- 2
463
- x
464
- 10
465
- test_file?
466
- x
467
- 12
468
- test_folder?
469
- p
470
- 3
471
- I
472
- 0
473
- I
474
- a
475
- I
476
- 17
477
- x
478
- 78
479
- /Users/remy/Development/Ruby/Gems/guard/guard-test/lib/guard/test/inspector.rb
480
- p
481
- 1
482
- x
483
- 1
484
- p
485
- x
486
- 6
487
- select
488
412
  x
489
413
  3
490
414
  dup
@@ -501,59 +425,94 @@ x
501
425
  5
502
426
  clean
503
427
  i
504
- 50
428
+ 85
505
429
  57
506
430
  19
507
431
  0
508
432
  15
509
- 45
510
- 0
511
- 1
433
+ 5
512
434
  20
513
435
  0
436
+ 47
514
437
  49
515
- 2
438
+ 0
516
439
  1
517
440
  9
518
- 48
441
+ 64
519
442
  21
520
443
  1
521
444
  0
522
445
  20
523
446
  0
524
447
  49
525
- 3
448
+ 1
526
449
  1
527
450
  15
528
451
  21
529
452
  1
530
453
  0
531
454
  45
532
- 4
533
- 5
455
+ 2
456
+ 3
534
457
  20
535
458
  0
536
459
  47
537
460
  101
461
+ 4
462
+ 7
463
+ 5
464
+ 63
465
+ 2
466
+ 49
538
467
  6
468
+ 1
469
+ 45
470
+ 2
539
471
  7
472
+ 20
473
+ 0
474
+ 47
475
+ 101
476
+ 4
540
477
  7
478
+ 8
541
479
  63
542
480
  2
543
481
  49
544
- 8
482
+ 6
545
483
  1
546
484
  81
547
485
  9
486
+ 81
487
+ 9
548
488
  22
549
489
  1
550
490
  0
551
491
  8
492
+ 84
493
+ 5
494
+ 20
495
+ 0
496
+ 47
552
497
  49
498
+ 10
499
+ 1
500
+ 9
501
+ 76
502
+ 1
503
+ 8
504
+ 84
505
+ 21
506
+ 1
507
+ 0
508
+ 20
509
+ 0
510
+ 49
511
+ 1
553
512
  1
554
513
  11
555
514
  I
556
- 6
515
+ 7
557
516
  I
558
517
  1
559
518
  I
@@ -562,14 +521,10 @@ I
562
521
  1
563
522
  n
564
523
  p
565
- 10
566
- x
567
- 4
568
- File
569
- n
524
+ 11
570
525
  x
571
- 10
572
- directory?
526
+ 12
527
+ test_folder?
573
528
  x
574
529
  6
575
530
  delete
@@ -582,41 +537,48 @@ x
582
537
  to_s
583
538
  s
584
539
  13
585
- /**/*_test.rb
540
+ /**/test_*.rb
586
541
  x
587
542
  4
588
543
  glob
544
+ n
545
+ s
546
+ 13
547
+ /**/*_test.rb
589
548
  x
590
549
  1
591
550
  +
551
+ x
552
+ 10
553
+ test_file?
592
554
  p
593
555
  13
594
556
  I
595
557
  0
596
558
  I
597
- c
559
+ b
598
560
  I
599
561
  4
600
562
  I
601
- d
563
+ c
602
564
  I
603
- e
565
+ d
604
566
  I
605
- e
567
+ d
606
568
  I
607
- 17
569
+ 16
608
570
  I
609
- f
571
+ e
610
572
  I
611
- 30
573
+ 40
612
574
  I
613
- d
575
+ 10
614
576
  I
615
- 31
577
+ 54
616
578
  I
617
579
  0
618
580
  I
619
- 32
581
+ 55
620
582
  x
621
583
  78
622
584
  /Users/remy/Development/Ruby/Gems/guard/guard-test/lib/guard/test/inspector.rb
@@ -634,8 +596,14 @@ clear_test_files_list
634
596
  x
635
597
  4
636
598
  sort
637
- p
599
+ s
638
600
  19
601
+ test/test_helper.rb
602
+ x
603
+ 1
604
+ -
605
+ p
606
+ 17
639
607
  I
640
608
  -1
641
609
  I
@@ -651,29 +619,25 @@ I
651
619
  I
652
620
  c
653
621
  I
654
- a
655
- I
656
- 16
657
- I
658
- c
659
- I
660
- 21
661
- I
662
- 13
622
+ b
663
623
  I
664
- 27
624
+ 17
665
625
  I
666
626
  14
667
627
  I
668
- 2d
628
+ 1d
669
629
  I
670
630
  15
671
631
  I
672
- 31
632
+ 23
673
633
  I
674
634
  16
675
635
  I
676
- 37
636
+ 27
637
+ I
638
+ 17
639
+ I
640
+ 34
677
641
  x
678
642
  78
679
643
  /Users/remy/Development/Ruby/Gems/guard/guard-test/lib/guard/test/inspector.rb
@@ -812,11 +776,11 @@ p
812
776
  I
813
777
  -1
814
778
  I
815
- 1b
779
+ 1c
816
780
  I
817
781
  0
818
782
  I
819
- 1c
783
+ 1d
820
784
  I
821
785
  45
822
786
  x
@@ -870,11 +834,11 @@ p
870
834
  I
871
835
  -1
872
836
  I
873
- 1f
837
+ 20
874
838
  I
875
839
  0
876
840
  I
877
- 20
841
+ 21
878
842
  I
879
843
  9
880
844
  x
@@ -962,11 +926,11 @@ p
962
926
  I
963
927
  -1
964
928
  I
965
- 23
929
+ 24
966
930
  I
967
931
  0
968
932
  I
969
- 24
933
+ 25
970
934
  I
971
935
  1d
972
936
  x
@@ -1009,11 +973,11 @@ p
1009
973
  I
1010
974
  -1
1011
975
  I
1012
- 27
976
+ 28
1013
977
  I
1014
978
  0
1015
979
  I
1016
- 28
980
+ 29
1017
981
  I
1018
982
  4
1019
983
  x
@@ -1030,23 +994,23 @@ I
1030
994
  I
1031
995
  10
1032
996
  I
1033
- 19
997
+ 1a
1034
998
  I
1035
999
  14
1036
1000
  I
1037
- 1b
1001
+ 1c
1038
1002
  I
1039
1003
  22
1040
1004
  I
1041
- 1f
1005
+ 20
1042
1006
  I
1043
1007
  30
1044
1008
  I
1045
- 23
1009
+ 24
1046
1010
  I
1047
1011
  3e
1048
1012
  I
1049
- 27
1013
+ 28
1050
1014
  I
1051
1015
  4c
1052
1016
  x
@@ -10,7 +10,6 @@ module Guard
10
10
  def initialize(options={})
11
11
  @runner_name = self.class.runners.detect { |runner| runner == options[:runner] } || self.class.runners[0]
12
12
  @options = {
13
- :notification => true,
14
13
  :bundler => File.exist?("#{Dir.pwd}/Gemfile"),
15
14
  :rvm => nil,
16
15
  :cli => nil
@@ -51,10 +50,10 @@ module Guard
51
50
  cmd_parts << "bundle exec" if @options[:bundler] && !turn?
52
51
  cmd_parts << "#{turn? ? 'turn' : 'ruby'} -Itest"
53
52
  cmd_parts << "-r bundler/setup" if @options[:bundler] && !turn?
54
-
53
+
55
54
  unless turn?
56
55
  cmd_parts << "-r #{File.expand_path("../runners/#{@runner_name}_guard_test_runner", __FILE__)}"
57
- cmd_parts << "-e \"GUARD_TEST_NOTIFY=#{@options[:notification]}\""
56
+ cmd_parts << "-e \"%w[#{paths.join(' ')}].each { |p| load p }\""
58
57
  end
59
58
 
60
59
  paths.each { |path| cmd_parts << "\"./#{path}\"" }