aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib')
-rw-r--r--activesupport/lib/active_support/test_case.rb6
-rw-r--r--activesupport/lib/active_support/testing/isolation.rb7
2 files changed, 11 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/test_case.rb b/activesupport/lib/active_support/test_case.rb
index 573736ede7..f0f83a747c 100644
--- a/activesupport/lib/active_support/test_case.rb
+++ b/activesupport/lib/active_support/test_case.rb
@@ -1,4 +1,8 @@
-require 'test/unit/testcase'
+begin
+ require 'test/unit/testcase'
+rescue LoadError => e
+ raise LoadError, "Please add test-unit gem to your Gemfile: `gem 'test-unit', '~> 3.0'` (#{e.message})", e.backtrace
+end
require 'active_support/testing/setup_and_teardown'
require 'active_support/testing/assertions'
require 'active_support/testing/deprecation'
diff --git a/activesupport/lib/active_support/testing/isolation.rb b/activesupport/lib/active_support/testing/isolation.rb
index 77c04758ba..d762522d29 100644
--- a/activesupport/lib/active_support/testing/isolation.rb
+++ b/activesupport/lib/active_support/testing/isolation.rb
@@ -156,7 +156,12 @@ end
# Only in subprocess for windows / jruby.
if ENV['ISOLATION_TEST']
- require "test/unit/collector/objectspace"
+ begin
+ require "test/unit/collector/objectspace"
+ rescue LoadError => e
+ raise LoadError, "Please add test-unit gem to your Gemfile: `gem 'test-unit', '~> 3.0'` (#{e.message})", e.backtrace
+ end
+
class Test::Unit::Collector::ObjectSpace
def include?(test)
super && test.method_name == ENV['ISOLATION_TEST']