minitest 1.4.0 → 1.4.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.
Files changed (5) hide show
  1. data.tar.gz.sig +0 -0
  2. data/History.txt +14 -0
  3. data/lib/minitest/unit.rb +38 -5
  4. metadata +3 -3
  5. metadata.gz.sig +0 -0
data.tar.gz.sig CHANGED
Binary file
@@ -1,3 +1,17 @@
1
+ === 1.4.1 / 2009-06-23
2
+
3
+ * 1 major enhancement:
4
+
5
+ * Handle ^C and other fatal exceptions by failing
6
+
7
+ * 1 minor enhancement:
8
+
9
+ * Added something to catch mixed use of test/unit and minitest if $DEBUG
10
+
11
+ * 1 bug fix:
12
+
13
+ * Added SIGINFO handler for finding slow tests without verbose
14
+
1
15
  === 1.4.0 / 2009-06-18
2
16
 
3
17
  * 5 minor enhancement:
@@ -313,10 +313,11 @@ module MiniTest
313
313
  end
314
314
 
315
315
  class Unit
316
- VERSION = "1.4.0"
316
+ VERSION = "1.4.1"
317
317
 
318
318
  attr_accessor :report, :failures, :errors, :skips
319
319
  attr_accessor :test_count, :assertion_count
320
+ attr_accessor :start_time
320
321
 
321
322
  @@installed_at_exit ||= false
322
323
  @@out = $stdout
@@ -394,10 +395,16 @@ module MiniTest
394
395
 
395
396
  @@out.puts
396
397
 
397
- format = "%d tests, %d assertions, %d failures, %d errors, %d skips"
398
- @@out.puts format % [test_count, assertion_count, failures, errors, skips]
398
+ status
399
399
 
400
400
  return failures + errors if @test_count > 0 # or return nil...
401
+ rescue Interrupt
402
+ abort 'Interrupted'
403
+ end
404
+
405
+ def status io = @@out
406
+ format = "%d tests, %d assertions, %d failures, %d errors, %d skips"
407
+ io.puts format % [test_count, assertion_count, failures, errors, skips]
401
408
  end
402
409
 
403
410
  def run_test_suites filter = /./
@@ -409,10 +416,10 @@ module MiniTest
409
416
  inst._assertions = 0
410
417
  @@out.print "#{suite}##{test}: " if @verbose
411
418
 
412
- t = Time.now if @verbose
419
+ @start_time = Time.now
413
420
  result = inst.run(self)
414
421
 
415
- @@out.print "%.2f s: " % (Time.now - t) if @verbose
422
+ @@out.print "%.2f s: " % (Time.now - @start_time) if @verbose
416
423
  @@out.print result
417
424
  @@out.puts if @verbose
418
425
  @test_count += 1
@@ -426,22 +433,36 @@ module MiniTest
426
433
  class TestCase
427
434
  attr_reader :__name__
428
435
 
436
+ PASSTHROUGH_EXCEPTIONS = [NoMemoryError, SignalException, Interrupt,
437
+ SystemExit]
438
+
429
439
  def run runner
440
+ trap 'INFO' do
441
+ warn '%s#%s %.2fs' % [self.class, self.__name__,
442
+ (Time.now - runner.start_time)]
443
+ runner.status $stderr
444
+ end
445
+
430
446
  result = '.'
431
447
  begin
432
448
  @passed = nil
433
449
  self.setup
434
450
  self.__send__ self.__name__
435
451
  @passed = true
452
+ rescue *PASSTHROUGH_EXCEPTIONS
453
+ raise
436
454
  rescue Exception => e
437
455
  @passed = false
438
456
  result = runner.puke(self.class, self.__name__, e)
439
457
  ensure
440
458
  begin
441
459
  self.teardown
460
+ rescue *PASSTHROUGH_EXCEPTIONS
461
+ raise
442
462
  rescue Exception => e
443
463
  result = runner.puke(self.class, self.__name__, e)
444
464
  end
465
+ trap 'INFO', 'DEFAULT'
445
466
  end
446
467
  result
447
468
  end
@@ -493,3 +514,15 @@ module MiniTest
493
514
  end # class TestCase
494
515
  end # class Test
495
516
  end # module Mini
517
+
518
+ if $DEBUG then
519
+ # this helps me ferret out porting issues
520
+ module Test; end
521
+ module Test::Unit; end
522
+ class Test::Unit::TestCase
523
+ def self.inherited x
524
+ raise "You're running minitest and test/unit in the same process: #{x}"
525
+ end
526
+ end
527
+ end
528
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minitest
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Davis
@@ -30,7 +30,7 @@ cert_chain:
30
30
  FBHgymkyj/AOSqKRIpXPhjC6
31
31
  -----END CERTIFICATE-----
32
32
 
33
- date: 2009-06-18 00:00:00 -07:00
33
+ date: 2009-06-23 00:00:00 -07:00
34
34
  default_executable:
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
@@ -41,7 +41,7 @@ dependencies:
41
41
  requirements:
42
42
  - - ">="
43
43
  - !ruby/object:Gem::Version
44
- version: 2.1.0
44
+ version: 2.3.0
45
45
  version:
46
46
  description: |-
47
47
  minitest/unit is a small and fast replacement for ruby's huge and slow
metadata.gz.sig CHANGED
Binary file