Don't isolate tests as possible

to speed-up running tests
This commit is contained in:
Takashi Kokubun 2017-04-18 22:13:15 +09:00
parent ae4afd083f
commit 40387a4f9c
1 changed files with 12 additions and 6 deletions

View File

@ -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)