Permalink
Browse files

Fix support for ActiveSupport 3.x.

Refs #67.
  • Loading branch information...
1 parent e9a24ad commit ca53fb7d674d3d0286638370f572516d05aba101 Alex Kern committed Apr 5, 2013
Showing with 29 additions and 1 deletion.
  1. +1 −1 Gemfile
  2. +21 −0 lib/minitest/old_activesupport_fix.rb
  3. +7 −0 lib/minitest/reporters.rb
View
@@ -1,2 +1,2 @@
-source :rubygems
+source "https://rubygems.org"
gemspec
@@ -0,0 +1,21 @@
+require "active_support/testing/setup_and_teardown"
+
+module ActiveSupport
+ module Testing
+ module SetupAndTeardown
+ module ForMiniTest
+ remove_method :run
+
+ def before_setup
+ super
+ run_callbacks :setup
+ end
+
+ def after_teardown
+ run_callbacks :teardown
+ super
+ end
+ end
+ end
+ end
+end
@@ -25,6 +25,7 @@ def self.use!(console_reporters = ProgressReporter.new, env = ENV, backtrace_fil
use_around_test_hooks!
use_backtrace_filter!(backtrace_filter)
use_parallel_length_method!
+ use_old_activesupport_fix!
end
def self.use_runner!(console_reporters, env)
@@ -82,5 +83,11 @@ def self.use_parallel_length_method!
end
end
end
+
+ def self.use_old_activesupport_fix!
+ if defined?(ActiveSupport) && ActiveSupport::VERSION::MAJOR < 4
+ require "minitest/old_activesupport_fix"
+ end
+ end
end
end

0 comments on commit ca53fb7

Please sign in to comment.