incubator-deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lut...@apache.org
Subject svn commit: r962299 - /incubator/deltacloud/trunk/server/Rakefile
Date Thu, 08 Jul 2010 23:44:32 GMT
Author: lutter
Date: Thu Jul  8 23:44:32 2010
New Revision: 962299

URL: http://svn.apache.org/viewvc?rev=962299&view=rev
Log:
Cucumber tasks are now optional

Modified:
    incubator/deltacloud/trunk/server/Rakefile

Modified: incubator/deltacloud/trunk/server/Rakefile
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/Rakefile?rev=962299&r1=962298&r2=962299&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/Rakefile (original)
+++ incubator/deltacloud/trunk/server/Rakefile Thu Jul  8 23:44:32 2010
@@ -19,10 +19,10 @@
 # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
 
 require 'rake'
-require 'cucumber'
 require 'rake/testtask'
 require 'rake/gempackagetask'
-require 'cucumber/rake/task'
+
+
 
 desc "Run basic unit tests"
 Rake::TestTask.new("test") { |t|
@@ -37,17 +37,28 @@ Rake::TestTask.new("test") { |t|
   t.warning = false
 }
 
-Cucumber::Rake::Task.new(:features) do |t|
-  t.cucumber_opts = "features --format html --out tmp/cucumber.html"
-  t.rcov = false
-end
+begin
+  require 'cucumber'
+  require 'cucumber/rake/task'
+
+  Cucumber::Rake::Task.new(:features) do |t|
+    t.cucumber_opts = "features --format html --out tmp/cucumber.html"
+    t.rcov = false
+  end
 
-Cucumber::Rake::Task.new(:rcov) do |t|
-  t.cucumber_opts = "features --format pretty"
-  t.rcov = true
-  t.rcov_opts << %[-o "tmp/coverage"]
+  Cucumber::Rake::Task.new(:rcov) do |t|
+    t.cucumber_opts = "features --format pretty"
+    t.rcov = true
+    t.rcov_opts << %[-o "tmp/coverage"]
+  end
+rescue LoadError
+  desc 'Cucumber rake task not available'
+  task :features do
+    abort 'Cucumber rake task is not available. Be sure to install cucumber as a gem'
+  end
 end
 
+
 load 'deltacloud-core.gemspec'
 Rake::GemPackageTask.new(@spec) do |pkg|
   pkg.need_tar = true



Mime
View raw message