summaryrefslogtreecommitdiff
path: root/tasks
diff options
context:
space:
mode:
authorAdam Jacob <adam@hjksolutions.com>2008-03-07 17:28:27 -0800
committerAdam Jacob <adam@hjksolutions.com>2008-03-07 17:28:27 -0800
commitb4beed548959ca63365ca3d799c59a155047b5ff (patch)
tree91207c05fb2517b1b87b0eb1f3deb111d6b058d9 /tasks
parentaca232ba638afdc45f6d5b3e9b3f68d4a149d0a5 (diff)
downloadchef-b4beed548959ca63365ca3d799c59a155047b5ff.tar.gz
Syntax is right in the recipes
Diffstat (limited to 'tasks')
-rw-r--r--tasks/rspec.rb52
1 files changed, 49 insertions, 3 deletions
diff --git a/tasks/rspec.rb b/tasks/rspec.rb
index f3c2d7d25b..077840d31d 100644
--- a/tasks/rspec.rb
+++ b/tasks/rspec.rb
@@ -2,7 +2,53 @@ require 'rubygems'
require 'rake'
require 'spec/rake/spectask'
-desc "Run all examples"
-Spec::Rake::SpecTask.new('spec') do |t|
- t.spec_files = FileList[File.join(File.dirname(__FILE__), "..", "spec", "**", "*.rb")]
+#desc "Run all examples"
+#Spec::Rake::SpecTask.new('spec') do |t|
+# t.spec_files = FileList[File.join(File.dirname(__FILE__), "..", "spec", "**", "*.rb")]
+#end
+
+require 'spec/rake/spectask'
+require 'spec/translator'
+
+MARIONETTE_ROOT = File.join(File.dirname(__FILE__), "..")
+
+task :default => :spec
+
+desc "Run all specs in spec directory"
+Spec::Rake::SpecTask.new(:spec) do |t|
+ t.spec_opts = ['--options', "\"#{MARIONETTE_ROOT}/spec/spec.opts\""]
+ t.spec_files = FileList['spec/**/*_spec.rb']
end
+
+namespace :spec do
+ desc "Run all specs in spec directory with RCov"
+ Spec::Rake::SpecTask.new(:rcov) do |t|
+ t.spec_opts = ['--options', "\"#{MARIONETTE_ROOT}/spec/spec.opts\""]
+ t.spec_files = FileList['spec/**/*_spec.rb']
+ t.rcov = true
+ t.rcov_opts = lambda do
+ IO.readlines("#{MARIONETTE_ROOT}/spec/rcov.opts").map {|l| l.chomp.split " "}.flatten
+ end
+ end
+
+ desc "Print Specdoc for all specs"
+ Spec::Rake::SpecTask.new(:doc) do |t|
+ t.spec_opts = ["--format", "specdoc", "--dry-run"]
+ t.spec_files = FileList['spec/**/*_spec.rb']
+ end
+
+ [:unit].each do |sub|
+ desc "Run the specs under spec/#{sub}"
+ Spec::Rake::SpecTask.new(sub) do |t|
+ t.spec_opts = ['--options', "\"#{MARIONETTE_ROOT}/spec/spec.opts\""]
+ t.spec_files = FileList["spec/#{sub}/**/*_spec.rb"]
+ end
+ end
+
+ desc "Translate/upgrade specs using the built-in translator"
+ task :translate do
+ translator = ::Spec::Translator.new
+ dir = MARIONETTE_ROOT + '/spec'
+ translator.translate(dir, dir)
+ end
+end \ No newline at end of file