ZenTest 4.9.2 → 4.9.3

Sign up to get free protection for your applications and to get access to all the features.
data.tar.gz.sig CHANGED
Binary file
@@ -1,3 +1,14 @@
1
+ === 4.9.3 / 2013-08-12
2
+
3
+ * 1 minor enhancement:
4
+
5
+ * Added --debug option. Probably need to add more to help bug reports.
6
+
7
+ * 2 bug fixes:
8
+
9
+ * Fixed completed_re and failed_results_re to match minitest 5 (and still mt 4).
10
+ * Fixed handle_results to deal with minitest 5 output (eg ClassName#method_name).
11
+
1
12
  === 4.9.2 / 2013-05-29
2
13
 
3
14
  * 2 minor enhancements:
@@ -112,6 +112,10 @@ class Autotest
112
112
  options[:no_full_after_failed] = true
113
113
  end
114
114
 
115
+ opts.on "-d", "--debug", "Debug mode, for reporting bugs." do
116
+ options[:debug] = true
117
+ end
118
+
115
119
  opts.on "-v", "--verbose", "Be annoyingly verbose (debugs .autotest)." do
116
120
  options[:verbose] = true
117
121
  end
@@ -279,10 +283,10 @@ class Autotest
279
283
  @child = nil
280
284
 
281
285
  self.completed_re =
282
- /\d+ tests, \d+ assertions, \d+ failures, \d+ errors(, \d+ skips)?/
286
+ /\d+ (tests|runs), \d+ assertions, \d+ failures, \d+ errors(, \d+ skips)?/
283
287
  self.extra_class_map = {}
284
288
  self.extra_files = []
285
- self.failed_results_re = /^\s+\d+\) (?:Failure|Error):\n(.*?)\((.*?)\)/
289
+ self.failed_results_re = /^\s+\d+\) (?:Failure|Error):\n(.*?)[\(\[](.*?)[\)\]]/
286
290
  self.files_to_test = new_hash_of_arrays
287
291
  self.find_order = []
288
292
  self.known_files = nil
@@ -316,6 +320,30 @@ class Autotest
316
320
  end
317
321
  end
318
322
 
323
+ def debug
324
+ require "pp"
325
+ find_files_to_test
326
+
327
+ puts "Known test files:"
328
+ puts
329
+ pp files_to_test.keys.sort
330
+
331
+ class_map = self.class_map
332
+
333
+ puts
334
+ puts "Known class map:"
335
+ puts
336
+ pp class_map
337
+ end
338
+
339
+ def class_map
340
+ class_map = Hash[*self.find_order.grep(/^test/).map { |f| # TODO: ugly
341
+ [path_to_classname(f), f]
342
+ }.flatten]
343
+ class_map.merge! self.extra_class_map
344
+ class_map
345
+ end
346
+
319
347
  ##
320
348
  # Repeatedly run failed tests, then all tests, then wait for changes
321
349
  # and carry on until killed.
@@ -329,6 +357,8 @@ class Autotest
329
357
 
330
358
  self.last_mtime = Time.now if options[:no_full_after_start]
331
359
 
360
+ self.debug if options[:debug]
361
+
332
362
  loop do
333
363
  begin # ^c handler
334
364
  get_to_green
@@ -344,6 +374,7 @@ class Autotest
344
374
  end
345
375
  end
346
376
  hook :quit
377
+ puts
347
378
  rescue Exception => err
348
379
  hook(:died, err) or raise err
349
380
  end
@@ -483,10 +514,7 @@ class Autotest
483
514
  def consolidate_failures failed
484
515
  filters = new_hash_of_arrays
485
516
 
486
- class_map = Hash[*self.find_order.grep(/^test/).map { |f| # TODO: ugly
487
- [path_to_classname(f), f]
488
- }.flatten]
489
- class_map.merge! self.extra_class_map
517
+ class_map = self.class_map
490
518
 
491
519
  failed.each do |method, klass|
492
520
  if class_map.has_key? klass then
@@ -564,7 +592,11 @@ class Autotest
564
592
 
565
593
  def handle_results results
566
594
  results = results.gsub(/\e\[\d+m/, '') # strip ascii color
567
- failed = results.scan self.failed_results_re
595
+ failed = results.scan(self.failed_results_re).map { |m, k|
596
+ k, m = $1, $2 if m =~ /(\w+)\#(\w+)/ # minitest 5 output
597
+ [m, k]
598
+ }
599
+
568
600
  completed = results[self.completed_re]
569
601
 
570
602
  if completed then
@@ -603,6 +635,13 @@ class Autotest
603
635
  # Generate the commands to test the supplied files
604
636
 
605
637
  def make_test_cmd files_to_test
638
+ if options[:debug] then
639
+ puts "Files to test:"
640
+ puts
641
+ pp files_to_test
642
+ puts
643
+ end
644
+
606
645
  cmds = []
607
646
  full, partial = reorder(files_to_test).partition { |k,v| v.empty? }
608
647
  diff = self.unit_diff
@@ -64,7 +64,7 @@ end
64
64
 
65
65
  class ZenTest
66
66
 
67
- VERSION = "4.9.2"
67
+ VERSION = "4.9.3"
68
68
 
69
69
  include ZenTestMapping
70
70
 
@@ -470,14 +470,11 @@ test_error2(#{@test_class}):
470
470
  end
471
471
 
472
472
  def test_runner_accepts_rc_options
473
- begin
474
- Autotest.parse_options(['--rc', 'autotest_rc'])
475
- Autotest.new
476
- rescue
477
- deny $!, "It should not throw #{$!.message}"
478
- ensure
479
- Autotest.reset_options
480
- end
473
+ exp = {:rc=>["autotest_rc"], :args=>["--rc", "autotest_rc"]}
474
+ assert_equal exp, Autotest.parse_options(['--rc', 'autotest_rc'])
475
+ assert_kind_of Autotest, Autotest.new
476
+ ensure
477
+ Autotest.reset_options
481
478
  end
482
479
 
483
480
  def util_exceptions
@@ -451,11 +451,11 @@ end
451
451
  end
452
452
 
453
453
  def test_load_file
454
- # HACK raise NotImplementedError, 'Need to write test_load_file'
454
+ skip 'Need to write test_load_file'
455
455
  end
456
456
 
457
457
  def test_scan_files
458
- # HACK raise NotImplementedError, 'Need to write test_scan_files'
458
+ skip 'Need to write test_scan_files'
459
459
  end
460
460
 
461
461
  def test_process_class
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ZenTest
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 29
5
5
  prerelease:
6
6
  segments:
7
7
  - 4
8
8
  - 9
9
- - 2
10
- version: 4.9.2
9
+ - 3
10
+ version: 4.9.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ryan Davis
@@ -37,7 +37,7 @@ cert_chain:
37
37
  FBHgymkyj/AOSqKRIpXPhjC6
38
38
  -----END CERTIFICATE-----
39
39
 
40
- date: 2013-05-30 00:00:00 Z
40
+ date: 2013-08-13 00:00:00 Z
41
41
  dependencies:
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: minitest
@@ -77,11 +77,11 @@ dependencies:
77
77
  requirements:
78
78
  - - ~>
79
79
  - !ruby/object:Gem::Version
80
- hash: 11
80
+ hash: 9
81
81
  segments:
82
82
  - 3
83
- - 6
84
- version: "3.6"
83
+ - 7
84
+ version: "3.7"
85
85
  type: :development
86
86
  version_requirements: *id003
87
87
  description: |-
@@ -165,8 +165,8 @@ files:
165
165
  - test/test_zentest_mapping.rb
166
166
  - .gemtest
167
167
  homepage: https://github.com/seattlerb/zentest
168
- licenses: []
169
-
168
+ licenses:
169
+ - MIT
170
170
  post_install_message:
171
171
  rdoc_options:
172
172
  - --main
metadata.gz.sig CHANGED
@@ -1 +1,2 @@
1
- �٨c7ʏ"+B�71�"7?j�VK�5��C���D�*���H�ot���F7ac�'}Ғdϟ�AE�y�r�33ݱy�o�iN'� p�ƚ����Cb���9 Z� �F�ϒ��?���`�;a���N������۹/Γ(z����P�����@k�L�@���j�:J��#�%P��n�*ʥ9 ��b<��?K:��y�G�6�����|�9cP��Kkf�P|0?�4���5���1���� odڣĆS�Dv�E6
1
+ |h�B{���2g�3������H$/G�<���bް�:���h2=�JY฀
2
+ u