2015-10-06 15:18:41 +00:00
|
|
|
require 'bundler/gem_tasks'
|
|
|
|
require 'rake/testtask'
|
|
|
|
|
2015-10-11 09:34:08 +00:00
|
|
|
begin
|
|
|
|
origin, $stdout = $stdout, StringIO.new
|
|
|
|
Bundler.require
|
|
|
|
ensure
|
|
|
|
$stdout = origin
|
|
|
|
end
|
2015-10-06 15:18:41 +00:00
|
|
|
|
2015-10-11 08:58:11 +00:00
|
|
|
Dir['benchmark/*.rake'].each { |b| import(b) }
|
|
|
|
|
2015-10-06 15:18:41 +00:00
|
|
|
Rake::TestTask.new do |t|
|
|
|
|
t.libs << 'lib' << 'test'
|
|
|
|
files = Dir['test/*_test.rb']
|
2015-10-11 04:31:15 +00:00
|
|
|
files << 'test/haml-spec/*_test.rb'
|
2015-10-11 03:13:03 +00:00
|
|
|
t.ruby_opts = %w[-rtest_helper]
|
2015-10-06 15:18:41 +00:00
|
|
|
t.test_files = files
|
|
|
|
t.verbose = true
|
|
|
|
end
|
2015-10-11 09:34:08 +00:00
|
|
|
task default: :test
|
2015-10-13 13:02:16 +00:00
|
|
|
|
|
|
|
Rake::TestTask.new(:spec) do |t|
|
|
|
|
t.libs << 'lib' << 'test'
|
|
|
|
t.ruby_opts = %w[-rtest_helper]
|
|
|
|
t.test_files = %w[test/haml-spec/ugly_test.rb test/haml-spec/pretty_test.rb]
|
|
|
|
t.verbose = true
|
|
|
|
end
|
2015-10-15 15:22:23 +00:00
|
|
|
|
|
|
|
namespace :test do
|
|
|
|
Rake::TestTask.new(:engine) do |t|
|
|
|
|
t.libs << 'lib' << 'test'
|
|
|
|
t.ruby_opts = %w[-rtest_helper]
|
|
|
|
t.test_files = %w[test/engine_test.rb]
|
|
|
|
t.verbose = true
|
|
|
|
end
|
|
|
|
|
|
|
|
Rake::TestTask.new(:filters) do |t|
|
|
|
|
t.libs << 'lib' << 'test'
|
|
|
|
t.ruby_opts = %w[-rtest_helper]
|
|
|
|
t.test_files = %w[test/filters_test.rb]
|
|
|
|
t.verbose = true
|
|
|
|
end
|
|
|
|
|
|
|
|
Rake::TestTask.new(:helper) do |t|
|
|
|
|
t.libs << 'lib' << 'test'
|
|
|
|
t.ruby_opts = %w[-rtest_helper]
|
|
|
|
t.test_files = %w[test/helper_test.rb]
|
|
|
|
t.verbose = true
|
|
|
|
end
|
|
|
|
|
|
|
|
Rake::TestTask.new(:template) do |t|
|
|
|
|
t.libs << 'lib' << 'test'
|
|
|
|
t.ruby_opts = %w[-rtest_helper]
|
|
|
|
t.test_files = %w[test/template_test.rb]
|
|
|
|
t.verbose = true
|
|
|
|
end
|
|
|
|
end
|