minitest 4.7.3 → 4.7.5

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.tar.gz.sig CHANGED
Binary file
data/History.txt CHANGED
@@ -1,3 +1,25 @@
1
+ === 4.7.5 / 2013-06-21
2
+
3
+ * 2 bug fixes:
4
+
5
+ * Fix Spec#describe_stack to be thread local.
6
+ * Fix multithreaded test failures by defining Time local to mock test namespace
7
+
8
+ === 4.7.4 / 2013-05-01
9
+
10
+ This is probably the last release of the 4.x series. It will be merged
11
+ to ruby and will be put into maintenance mode there.
12
+
13
+ I'm not set in stone on this, but at this point further development of
14
+ minitest (5+) will be gem-only. It is just too hard to work w/in
15
+ ruby-core w/ test-unit compatibility holding minitest development
16
+ back.
17
+
18
+ * 2 minor enhancements:
19
+
20
+ * Added count/size to ParallelEach to fix use w/in stdlib's test/unit. :( (btaitelb)
21
+ * Allow disabling of info_signal handler in runner. (erikh)
22
+
1
23
  === 4.7.3 / 2013-04-20
2
24
 
3
25
  * 1 bug fix:
@@ -48,6 +48,12 @@ class ParallelEach
48
48
  }
49
49
  threads.map(&:join)
50
50
  end
51
+
52
+ def count
53
+ [@queue.size - N, 0].max
54
+ end
55
+
56
+ alias_method :size, :count
51
57
  end
52
58
 
53
59
  class MiniTest::Unit
data/lib/minitest/spec.rb CHANGED
@@ -135,9 +135,8 @@ class MiniTest::Spec < MiniTest::Unit::TestCase
135
135
  }.last
136
136
  end
137
137
 
138
- @@describe_stack = []
139
138
  def describe_stack # :nodoc:
140
- @@describe_stack
139
+ Thread.current[:describe_stack] ||= []
141
140
  end
142
141
 
143
142
  ##
data/lib/minitest/unit.rb CHANGED
@@ -731,7 +731,7 @@ module MiniTest
731
731
  end
732
732
 
733
733
  class Unit # :nodoc:
734
- VERSION = "4.7.3" # :nodoc:
734
+ VERSION = "4.7.5" # :nodoc:
735
735
 
736
736
  attr_accessor :report, :failures, :errors, :skips # :nodoc:
737
737
  attr_accessor :assertion_count # :nodoc:
@@ -741,6 +741,17 @@ module MiniTest
741
741
  attr_accessor :verbose # :nodoc:
742
742
  attr_writer :options # :nodoc:
743
743
 
744
+ ##
745
+ # :attr:
746
+ #
747
+ # if true, installs an "INFO" signal handler (only available to BSD and
748
+ # OS X users) which prints diagnostic information about the test run.
749
+ #
750
+ # This is auto-detected by default but may be overridden by custom
751
+ # runners.
752
+
753
+ attr_accessor :info_signal
754
+
744
755
  ##
745
756
  # Lazy accessor for options.
746
757
 
@@ -987,6 +998,7 @@ module MiniTest
987
998
  @errors = @failures = @skips = 0
988
999
  @verbose = false
989
1000
  @mutex = defined?(Mutex) ? Mutex.new : nil
1001
+ @info_signal = Signal.list['INFO']
990
1002
  end
991
1003
 
992
1004
  def synchronize # :nodoc:
@@ -1221,8 +1233,6 @@ module MiniTest
1221
1233
  PASSTHROUGH_EXCEPTIONS = [NoMemoryError, SignalException,
1222
1234
  Interrupt, SystemExit] # :nodoc:
1223
1235
 
1224
- SUPPORTS_INFO_SIGNAL = Signal.list['INFO'] # :nodoc:
1225
-
1226
1236
  ##
1227
1237
  # Runs the tests reporting the status to +runner+
1228
1238
 
@@ -1235,7 +1245,7 @@ module MiniTest
1235
1245
  time = runner.start_time ? Time.now - runner.start_time : 0
1236
1246
  warn "Current Test: %s#%s %.2fs" % [self.class, self.__name__, time]
1237
1247
  runner.status $stderr
1238
- end if SUPPORTS_INFO_SIGNAL
1248
+ end if runner.info_signal
1239
1249
 
1240
1250
  start_time = Time.now
1241
1251
 
@@ -1269,7 +1279,7 @@ module MiniTest
1269
1279
  result = runner.puke self.class, self.__name__, e
1270
1280
  end
1271
1281
  end
1272
- trap 'INFO', 'DEFAULT' if SUPPORTS_INFO_SIGNAL
1282
+ trap 'INFO', 'DEFAULT' if runner.info_signal
1273
1283
  end
1274
1284
  result
1275
1285
  end
@@ -286,18 +286,22 @@ class TestMiniTestStub < MiniTest::Unit::TestCase
286
286
  assert_equal @assertion_count, @tc._assertions
287
287
  end
288
288
 
289
+ class Time
290
+ def self.now
291
+ 24
292
+ end
293
+ end
294
+
289
295
  def assert_stub val_or_callable
290
296
  @assertion_count += 1
291
297
 
292
- synchronize do
293
- t = Time.now.to_i
294
-
295
- Time.stub :now, val_or_callable do
296
- @tc.assert_equal 42, Time.now
297
- end
298
+ t = Time.now.to_i
298
299
 
299
- @tc.assert_operator Time.now.to_i, :>=, t
300
+ Time.stub :now, val_or_callable do
301
+ @tc.assert_equal 42, Time.now
300
302
  end
303
+
304
+ @tc.assert_operator Time.now.to_i, :>=, t
301
305
  end
302
306
 
303
307
  def test_stub_private_module_method
@@ -345,15 +349,13 @@ class TestMiniTestStub < MiniTest::Unit::TestCase
345
349
  def test_stub_block_args
346
350
  @assertion_count += 1
347
351
 
348
- synchronize do
349
- t = Time.now.to_i
350
-
351
- Time.stub :now, lambda { |n| n * 2 } do
352
- @tc.assert_equal 42, Time.now(21)
353
- end
352
+ t = Time.now.to_i
354
353
 
355
- @tc.assert_operator Time.now.to_i, :>=, t
354
+ Time.stub :now, lambda { |n| n * 2 } do
355
+ @tc.assert_equal 42, Time.now(21)
356
356
  end
357
+
358
+ @tc.assert_operator Time.now.to_i, :>=, t
357
359
  end
358
360
 
359
361
  def test_stub_callable
@@ -557,6 +557,10 @@ class TestMiniTestRunner < MetaMetaMetaTestCase
557
557
  end
558
558
  end
559
559
 
560
+ def test_parallel_each_size
561
+ assert_equal 0, ParallelEach.new([]).size
562
+ end
563
+
560
564
  def test_run_parallel
561
565
  skip "I don't have ParallelEach debugged yet" if maglev?
562
566
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minitest
3
3
  version: !ruby/object:Gem::Version
4
- hash: 37
4
+ hash: 41
5
5
  prerelease:
6
6
  segments:
7
7
  - 4
8
8
  - 7
9
- - 3
10
- version: 4.7.3
9
+ - 5
10
+ version: 4.7.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ryan Davis
@@ -36,7 +36,7 @@ cert_chain:
36
36
  FBHgymkyj/AOSqKRIpXPhjC6
37
37
  -----END CERTIFICATE-----
38
38
 
39
- date: 2013-04-21 00:00:00 Z
39
+ date: 2013-06-22 00:00:00 Z
40
40
  dependencies:
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rdoc
metadata.gz.sig CHANGED
Binary file