From 66271a1d358e73fffdcf04d1b51ed44e5c6327ef Mon Sep 17 00:00:00 2001 From: Akira Matsuda Date: Thu, 27 Apr 2017 18:58:54 +0900 Subject: [PATCH] Revert "Don't isolate tests as possible" This reverts commit 40387a4f9c0a8c44c360fc8e517bb0670ac49675. Reason: some tests fail on Rails 5.1 --- Rakefile | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/Rakefile b/Rakefile index 696fc8c9..782072a2 100644 --- a/Rakefile +++ b/Rakefile @@ -4,19 +4,13 @@ require "bundler/gem_tasks" task :default => :test -# FIXME: Redefining :test task to run test/options_test.rb in isolated process since it depends on whether Rails is loaded or not. +#FIXME: Redefining :test task to run each test in isolated process. # Remove this task when we finished changing escape_html option to be true by default. -isolated_test = Rake::TestTask.new do |t| - t.libs << 'test' - t.test_files = %w[test/options_test.rb] - t.warning = true - t.verbose = true -end -Rake::TestTask.new do |t| - t.libs << 'test' - t.test_files = Dir['test/*_test.rb'] + Dir['test/haml-spec/*_test.rb'] - isolated_test.file_list - t.warning = true - t.verbose = true +task :test do + test_files = Dir.glob('test/**/*_test.rb').reject { |f| f.start_with?('test/gemfiles/vendor/bundle') } + test_files.all? do |file| + sh(Gem.ruby, '-w', '-I/lib', '-Itest', file) + end || raise('Failures') end CLEAN.replace %w(pkg doc coverage .yardoc test/haml vendor)