Skip to content
Browse files

Bump up minitest dependency and remove our own reinvented version of …

…ParallelEach
  • Loading branch information...
1 parent 57b0ae8 commit 18c57c79ef7728aeb7f5a13f9136958a0d62ee1b @amatsuda amatsuda committed Feb 19, 2013
Showing with 2 additions and 38 deletions.
  1. +1 −1 activesupport/activesupport.gemspec
  2. +1 −37 activesupport/lib/active_support/testing/isolation.rb
View
2 activesupport/activesupport.gemspec
@@ -23,6 +23,6 @@ Gem::Specification.new do |s|
s.add_dependency 'i18n', '~> 0.6'
s.add_dependency 'multi_json', '~> 1.3'
s.add_dependency 'tzinfo', '~> 0.3.33'
- s.add_dependency 'minitest', '~> 4.1'
+ s.add_dependency 'minitest', '~> 4.2'
s.add_dependency 'thread_safe','~> 0.1'
end
View
38 activesupport/lib/active_support/testing/isolation.rb
@@ -1,8 +1,5 @@
require 'rbconfig'
-begin
- require 'minitest/parallel_each'
-rescue LoadError
-end
+require 'minitest/parallel_each'
module ActiveSupport
module Testing
@@ -48,39 +45,6 @@ def method_missing(name, *args)
module Isolation
require 'thread'
- # Recent versions of MiniTest (such as the one shipped with Ruby 2.0) already define
- # a ParallelEach class.
- unless defined? ParallelEach
- class ParallelEach
- include Enumerable
-
- # default to 2 cores
- CORES = (ENV['TEST_CORES'] || 2).to_i
-
- def initialize list
- @list = list
- @queue = SizedQueue.new CORES
- end
-
- def grep pattern
- self.class.new super
- end
-
- def each
- threads = CORES.times.map {
- Thread.new {
- while job = @queue.pop
- yield job
- end
- }
- }
- @list.each { |i| @queue << i }
- CORES.times { @queue << nil }
- threads.each(&:join)
- end
- end
- end
-
def self.included(klass) #:nodoc:
klass.extend(Module.new {
def test_methods

2 comments on commit 18c57c7

@zenspider

Not reinvented. I stole from rails. :P

@amatsuda
Ruby on Rails member

Ah, yes. I chose the wrong word then. Anyway, that's the way open source goes :)

Please sign in to comment.
Something went wrong with that request. Please try again.