From f20ecdfb249128ba79da069407dce32f6f7e2fca Mon Sep 17 00:00:00 2001
From: Azul <azul@riseup.net>
Date: Fri, 20 May 2016 11:47:38 +0200
Subject: include engine tests in default test

---
 lib/tasks/test.rake | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

(limited to 'lib')

diff --git a/lib/tasks/test.rake b/lib/tasks/test.rake
index d96b625..9859729 100644
--- a/lib/tasks/test.rake
+++ b/lib/tasks/test.rake
@@ -1,10 +1,15 @@
 namespace :test do
 
-  [:units, :functionals, :integration].each do |type|
-    Rails::SubTestTask.new(type => "test:prepare") do |t|
-      t.libs << "test"
-      subdir = type.to_s.singularize
-      t.pattern = "engines/*/test/#{subdir}/**/*_test.rb"
+  namespace :engines do
+    [:units, :functionals, :integration].each do |type|
+      desc "Test engine #{type}"
+      Rails::TestTask.new(type => "test:prepare") do |t|
+        t.libs << "test"
+        subdir = type.to_s.singularize
+        t.pattern = "engines/*/test/#{subdir}/**/*_test.rb"
+      end
+      Rake::Task["test:#{type}"].enhance ["test:engines:#{type}"]
+      Rake::Task["test"].enhance ["test:engines:#{type}"]
     end
   end
 
-- 
cgit v1.2.3