aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/commands/test.rb
diff options
context:
space:
mode:
authorKasper Timm Hansen <kaspth@gmail.com>2015-07-14 08:44:30 +0200
committerKasper Timm Hansen <kaspth@gmail.com>2015-07-14 08:44:30 +0200
commit368b9938ec9d8fbb8146e65c1edf744d32d207c9 (patch)
tree9ecbb530bbd0b5a13bef06deb3264b11fea3b933 /railties/lib/rails/commands/test.rb
parent908bc79729fdb3cc2acbd346d9ed34c9286d57cc (diff)
parent824246f66b21c89d4a646a3cb73e46134d97469d (diff)
downloadrails-368b9938ec9d8fbb8146e65c1edf744d32d207c9.tar.gz
rails-368b9938ec9d8fbb8146e65c1edf744d32d207c9.tar.bz2
rails-368b9938ec9d8fbb8146e65c1edf744d32d207c9.zip
Merge pull request #20870 from y-yagi/test_runner_inside_engine
make test runner work correctly inside engine
Diffstat (limited to 'railties/lib/rails/commands/test.rb')
-rw-r--r--railties/lib/rails/commands/test.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/railties/lib/rails/commands/test.rb b/railties/lib/rails/commands/test.rb
index fe5307788a..dd069f081f 100644
--- a/railties/lib/rails/commands/test.rb
+++ b/railties/lib/rails/commands/test.rb
@@ -1,5 +1,9 @@
require "rails/test_unit/minitest_plugin"
-$: << File.expand_path("../../test", APP_PATH)
+if defined?(ENGINE_ROOT)
+ $: << File.expand_path('test', ENGINE_ROOT)
+else
+ $: << File.expand_path('../../test', APP_PATH)
+end
exit Minitest.run(ARGV)