aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorKasper Timm Hansen <kaspth@gmail.com>2017-07-10 22:11:01 +0200
committerKasper Timm Hansen <kaspth@gmail.com>2017-07-16 20:55:37 +0200
commit519467babcce795193877ab4f8eefb23200e664f (patch)
tree444e7476f5549aae30e3528269ebf602a13a9191 /railties
parent83f39a3bcf3f50d12d41bff4a110c57e2e4be605 (diff)
downloadrails-519467babcce795193877ab4f8eefb23200e664f.tar.gz
rails-519467babcce795193877ab4f8eefb23200e664f.tar.bz2
rails-519467babcce795193877ab4f8eefb23200e664f.zip
Fix root not being defined on Travis.
Diffstat (limited to 'railties')
-rw-r--r--railties/lib/rails/test_unit/reporter.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/railties/lib/rails/test_unit/reporter.rb b/railties/lib/rails/test_unit/reporter.rb
index 1cc27f7b6c..ab28034d27 100644
--- a/railties/lib/rails/test_unit/reporter.rb
+++ b/railties/lib/rails/test_unit/reporter.rb
@@ -71,7 +71,12 @@ module Rails
end
def app_root
- @app_root ||= defined?(ENGINE_ROOT) ? ENGINE_ROOT : Rails.root
+ @app_root ||=
+ if defined?(ENGINE_ROOT)
+ ENGINE_ROOT
+ elsif Rails.respond_to?(:root)
+ Rails.root
+ end
end
def colored_output?