diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2012-05-03 22:27:16 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2012-05-03 22:27:16 +0200 |
commit | 2ee48c4f18470e733f244c659221e243ff998416 (patch) | |
tree | 62949886912b3dc5eb9e000b211e7f45f17ed978 /tasks/spec.rake | |
download | edoors-ruby-2ee48c4f18470e733f244c659221e243ff998416.zip edoors-ruby-2ee48c4f18470e733f244c659221e243ff998416.tar.gz |
initial commit
Diffstat (limited to 'tasks/spec.rake')
-rw-r--r-- | tasks/spec.rake | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/tasks/spec.rake b/tasks/spec.rake new file mode 100644 index 0000000..7345f5c --- /dev/null +++ b/tasks/spec.rake @@ -0,0 +1,44 @@ +# -*- coding: UTF-8 -*- +# +#if HAVE_SPEC_RAKE_SPECTASK and not PROJ.spec.files.to_a.empty? +require 'rspec/core/rake_task' +# +namespace :spec do + + desc 'Run all specs with basic output' + RSpec::Core::RakeTask.new(:run) do |t,args| + t.ruby_opts = PROJ.ruby_opts + t.rspec_opts = PROJ.spec.opts + t.pattern = ENV['pattern'] if ENV['pattern'] + end + + desc 'Run all specs with text output' + RSpec::Core::RakeTask.new(:doc) do |t| + t.ruby_opts = PROJ.ruby_opts + t.rspec_opts = PROJ.spec.opts + ['-fs' ] + t.pattern = ENV['pattern'] if ENV['pattern'] + end + + desc 'Run all specs with html output' + RSpec::Core::RakeTask.new(:html) do |t| + t.ruby_opts = PROJ.ruby_opts + t.rspec_opts = PROJ.spec.opts + ['-fh' ] + t.pattern = ENV['pattern'] if ENV['pattern'] + end + + if HAVE_RCOV + desc 'Run all specs with RCov' + RSpec::Core::RakeTask.new(:rcov) do |t| + t.ruby_opts = PROJ.ruby_opts + t.rspec_opts = PROJ.spec.opts + t.rcov = true + t.rcov_opts = PROJ.rcov.opts + ['--exclude', 'spec'] + end + end + +end # namespace :spec + +desc 'Alias to spec:run' +task :spec => 'spec:run' + +# EOF |