Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Infrastructure for Cucumber integration.

Now I just need to figure out how to implement CI::Reporter::Cucumber so that it reports the right information. :-)
  • Loading branch information...
commit 8b884ec95ae29ac35150e477728e9646029c5e89 1 parent 509a989
@mathie mathie authored
View
28 lib/ci/reporter/cucumber.rb
@@ -0,0 +1,28 @@
+# (c) Copyright 2006-2009 Nick Sieger <nicksieger@gmail.com>
+# See the file LICENSE.txt included with the distribution for
+# software license details.
+
+require 'ci/reporter/core'
+tried_gem = false
+begin
+ require 'cucumber'
+ require 'cucumber/formatter/progress'
+ require 'cucumber/formatter/pretty'
+rescue LoadError
+ unless tried_gem
+ tried_gem = true
+ require 'rubygems'
+ gem 'cucumber'
+ retry
+ end
+end
+
+module CI
+ module Reporter
+ class Cucumber < ::Cucumber::Formatter::Progress
+ end
+
+ class CucumberDoc < ::Cucumber::Formatter::Pretty
+ end
+ end
+end
View
23 lib/ci/reporter/rake/cucumber.rb
@@ -0,0 +1,23 @@
+# (c) Copyright 2006-2007 Nick Sieger <nicksieger@gmail.com>
+# See the file LICENSE.txt included with the distribution for
+# software license details.
+
+namespace :ci do
+ namespace :setup do
+ task :cucumber_report_cleanup do
+ rm_rf ENV["CI_REPORTS"] || "features/reports"
+ end
+
+ task :cucumber => :cucumber_report_cleanup do
+ spec_opts = ["--require", "#{File.dirname(__FILE__)}/cucumber_loader.rb",
+ "--format", "CI::Reporter::Cucumber"].join(" ")
+ ENV["CUCUMBER_OPTS"] = "#{ENV['CUCUMBER_OPTS']} #{spec_opts}"
+ end
+
+ task :cucumberdoc => :cucumber_report_cleanup do
+ spec_opts = ["--require", "#{File.dirname(__FILE__)}/cucumber_loader.rb",
+ "--format", "CI::Reporter::CucumberDoc"].join(" ")
+ ENV["CUCUMBER_OPTS"] = "#{ENV['CUCUMBER_OPTS']} #{spec_opts}"
+ end
+ end
+end
View
6 lib/ci/reporter/rake/cucumber_loader.rb
@@ -0,0 +1,6 @@
+# (c) Copyright 2006-2007 Nick Sieger <nicksieger@gmail.com>
+# See the file LICENSE.txt included with the distribution for
+# software license details.
+
+$: << File.dirname(__FILE__) + "/../../.."
+require 'ci/reporter/cucumber'
View
1  stub.rake
@@ -9,5 +9,6 @@
#
load File.dirname(__FILE__) + '/lib/ci/reporter/rake/rspec.rb'
+load File.dirname(__FILE__) + '/lib/ci/reporter/rake/cucumber.rb'
load File.dirname(__FILE__) + '/lib/ci/reporter/rake/test_unit.rb'
load 'Rakefile'
View
2  tasks/ci_reporter.rake
@@ -8,9 +8,11 @@ rescue Gem::LoadError
$: << File.dirname(__FILE__) + "/../lib"
end
require 'ci/reporter/rake/rspec'
+require 'ci/reporter/rake/cucumber'
require 'ci/reporter/rake/test_unit'
namespace :ci do
task :setup_rspec => "ci:setup:rspec"
+ task :setup_cucumber => "ci:setup:cucumber"
task :setup_testunit => "ci:setup:testunit"
end
Please sign in to comment.
Something went wrong with that request. Please try again.