aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2015-01-07 00:58:49 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2015-01-07 00:58:49 -0300
commit8f92edb2b4b6beb5c778283be7cbcef6bf7e596c (patch)
treed23e49209f81db38813c6cb0a8243a3a94bf882d /railties
parent292f6c99229f34ab216ddc9103e219143e637d85 (diff)
downloadrails-8f92edb2b4b6beb5c778283be7cbcef6bf7e596c.tar.gz
rails-8f92edb2b4b6beb5c778283be7cbcef6bf7e596c.tar.bz2
rails-8f92edb2b4b6beb5c778283be7cbcef6bf7e596c.zip
Remove hard dependency on test-unit
Instead show a error message asking users to add the gem to their Gemfile if test-unit could not be loaded.
Diffstat (limited to 'railties')
-rw-r--r--railties/lib/rails/test_help.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/railties/lib/rails/test_help.rb b/railties/lib/rails/test_help.rb
index 2efa25af7e..dc6999b4d5 100644
--- a/railties/lib/rails/test_help.rb
+++ b/railties/lib/rails/test_help.rb
@@ -2,7 +2,11 @@
# so fixtures aren't loaded into that environment
abort("Abort testing: Your Rails environment is running in production mode!") if Rails.env.production?
-require 'test/unit'
+begin
+ require 'test/unit'
+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/test_case'
require 'action_controller/test_case'
require 'action_dispatch/testing/integration'