1
0
Fork 0
mirror of https://github.com/haml/haml.git synced 2022-11-09 12:33:31 -05:00

Cleanup test rake tasks

This commit is contained in:
Takashi Kokubun 2015-11-26 01:02:11 +09:00
parent b3a615f10a
commit 514c01bcb1
2 changed files with 23 additions and 25 deletions

View file

@ -1,13 +1,6 @@
require 'bundler/gem_tasks' require 'bundler/gem_tasks'
require 'rake/testtask' require 'rake/testtask'
begin
origin, $stdout = $stdout, StringIO.new
Bundler.require
ensure
$stdout = origin
end
Dir['benchmark/*.rake'].each { |b| import(b) } Dir['benchmark/*.rake'].each { |b| import(b) }
namespace :haml do namespace :haml do
@ -29,26 +22,25 @@ namespace :hamlit do
t.verbose = true t.verbose = true
end end
end end
task default: 'hamlit:test'
Rake::TestTask.new do |t|
t.libs << 'lib' << 'test'
files = Dir['test/hamlit/**/*_test.rb']
files += Dir['test/haml/*_test.rb']
files << 'test/haml/haml-spec/*_test.rb'
t.ruby_opts = %w[-rtest_helper]
t.test_files = files
t.verbose = true
end
Rake::TestTask.new(:spec) do |t|
t.libs << 'lib' << 'test'
t.ruby_opts = %w[-rtest_helper]
t.test_files = %w[test/haml/haml-spec/ugly_test.rb test/haml/haml-spec/pretty_test.rb]
t.verbose = true
end
namespace :test do namespace :test do
Rake::TestTask.new(:all) do |t|
t.libs << 'lib' << 'test'
files = Dir['test/hamlit/**/*_test.rb']
files += Dir['test/haml/*_test.rb']
files << 'test/haml/haml-spec/*_test.rb'
t.ruby_opts = %w[-rtest_helper]
t.test_files = files
t.verbose = true
end
Rake::TestTask.new(:spec) do |t|
t.libs << 'lib' << 'test'
t.ruby_opts = %w[-rtest_helper]
t.test_files = %w[test/haml/haml-spec/ugly_test.rb test/haml/haml-spec/pretty_test.rb]
t.verbose = true
end
Rake::TestTask.new(:engine) do |t| Rake::TestTask.new(:engine) do |t|
t.libs << 'lib' << 'test' t.libs << 'lib' << 'test'
t.ruby_opts = %w[-rtest_helper] t.ruby_opts = %w[-rtest_helper]
@ -77,3 +69,6 @@ namespace :test do
t.verbose = true t.verbose = true
end end
end end
task default: %w[hamlit:test]
task test: %w[test:all]

View file

@ -12,6 +12,9 @@ build:
- script: - script:
name: clone hamlit1 name: clone hamlit1
code: bin/clone code: bin/clone
- script:
name: test all
code: bundle exec rake test
- script: - script:
name: "[benchmark] static attributes" name: "[benchmark] static attributes"
code: bin/bench bench -t benchmark/boolean_attribute.haml benchmark/class_attribute.haml benchmark/id_attribute.haml benchmark/data_attribute.haml benchmark/common_attribute.haml code: bin/bench bench -t benchmark/boolean_attribute.haml benchmark/class_attribute.haml benchmark/id_attribute.haml benchmark/data_attribute.haml benchmark/common_attribute.haml