summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Davis <ryand@zenspider.com>2010-11-15 17:13:10 -0800
committerRyan Davis <ryand@zenspider.com>2010-11-15 17:13:10 -0800
commitd54c9e32a6ef12b7e500b7f219e9f678d1690cf4 (patch)
treee21140c51ba299a6b17502207cebd5a0bea13bc6
parent1bd0f1e0626bfef746795c8810c3a4ca78a324b5 (diff)
downloadhoe-d54c9e32a6ef12b7e500b7f219e9f678d1690cf4.tar.gz
+ Added rspec2 support (bleything)
[git-p4: depot-paths = "//src/hoe/dev/": change = 5976]
-rw-r--r--lib/hoe/test.rb23
1 files changed, 20 insertions, 3 deletions
diff --git a/lib/hoe/test.rb b/lib/hoe/test.rb
index e58192a..c294b3b 100644
--- a/lib/hoe/test.rb
+++ b/lib/hoe/test.rb
@@ -91,8 +91,9 @@ module Hoe::Test
end
if File.directory? "spec" then
+ found = true
begin
- require 'spec/rake/spectask'
+ require 'spec/rake/spectask' # rspec 1
desc "Run all specifications"
Spec::Rake::SpecTask.new(:spec) do |t|
@@ -100,9 +101,25 @@ module Hoe::Test
t.spec_opts = self.rspec_options
end
rescue LoadError
- # do nothing
+ begin
+ require 'rspec/core/rake_task' # rspec 2
+
+ desc "Run all specifications"
+ RSpec::Core::RakeTask.new(:spec) do |t|
+ t.rspec_opts = self.rspec_options
+ t.rspec_opts << "-I#{self.rspec_dirs.join(":")}" unless
+ rspec_dirs.empty?
+ end
+ rescue LoadError
+ found = false
+ end
+ end
+
+ if found then
+ default_tasks << :spec
+ else
+ warn "Found spec dir, but couldn't load rspec (1 or 2) task. skipping."
end
- default_tasks << :spec
end
desc 'Run the default task(s).'