Skip to content

Commit

Permalink
Revert "Revert "Don't isolate tests as possible""
Browse files Browse the repository at this point in the history
This reverts commit 66271a1.
  • Loading branch information
k0kubun committed May 3, 2017
1 parent a1977c8 commit 19743dd
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions Rakefile
Expand Up @@ -4,13 +4,19 @@ require "bundler/gem_tasks"

task :default => :test

#FIXME: Redefining :test task to run each test in isolated process.
# FIXME: Redefining :test task to run test/options_test.rb in isolated process since it depends on whether Rails is loaded or not.
# Remove this task when we finished changing escape_html option to be true by default.
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')
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
end

CLEAN.replace %w(pkg doc coverage .yardoc test/haml vendor)
Expand Down

0 comments on commit 19743dd

Please sign in to comment.