Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

+ Added count/size to ParallelEach to fix use w/in stdlib's test/unit…

…. :( (btaitelb)

[git-p4: depot-paths = "//src/minitest/dev/": change = 8477]
  • Loading branch information...
commit 48f24b88a03cba6e356026b66bc199e78691be00 1 parent 54fd398
@zenspider zenspider authored
View
6 lib/minitest/parallel_each.rb
@@ -44,6 +44,12 @@ def each
}
threads.map(&:join)
end
+
+ def count
+ [@queue.size - N, 0].max
+ end
+
+ alias_method :size, :count
end
module Minitest
View
4 test/minitest/test_minitest_unit.rb
@@ -476,6 +476,10 @@ def await
end
end
+ def test_parallel_each_size
+ assert_equal 0, ParallelEach.new([]).size
+ end
+
def test_run_parallel
skip "I don't have ParallelEach debugged yet" if maglev?
Please sign in to comment.
Something went wrong with that request. Please try again.