Skip to content
Browse files

Add Aslak's patch for SPEC_OPTS (new in RSpec 1.0.6)

git-svn-id: http://svn.caldersphere.net/svn/main/rubyforge/ci_reporter/trunk@100 b03c2d0b-2f10-0410-a2f9-fc8001506dfa
  • Loading branch information...
1 parent 8a2ce16 commit 172f0a1833e665c41be6f2fcbaaf02ebc6032257 @nicksieger nicksieger committed
Showing with 27 additions and 14 deletions.
  1. +4 −0 History.txt
  2. +8 −4 README.txt
  3. +1 −1 Rakefile
  4. +7 −2 lib/ci/reporter/rake/rspec.rb
  5. +7 −7 spec/ci/reporter/rake/rake_tasks_spec.rb
View
4 History.txt
@@ -1,3 +1,7 @@
+== 1.3.3
+
+- Use SPEC_OPTS instead of RSPECOPTS (Aslak Hellesøy)
+
== 1.3.2
- Fix bug trying to modify frozen environment strings
View
12 README.txt
@@ -2,9 +2,7 @@ CI::Reporter is an add-on to Test::Unit and RSpec that allows you to generate XM
== Dependencies
-CI::Reporter has one required dependency on Builder, but since many will have a viable version of Builder via Rails' ActiveSupport gem, Builder is not a direct dependency of the project at the moment. Instead, ensure that you have either the +builder+ or +activesupport+ gem installed before continuing.
-
-*NOTE*: As of this release, CI::Reporter is only compatible with RSpec up through version 0.8.2. The 0.9 series has introduced an incompatibility that has not been rectified yet.
+CI::Reporter has one required dependency on Builder, but since many will have a viable version of Builder via Rails' ActiveSupport gem, Builder is not a direct dependency of the project at the moment. Instead, ensure that you have either the +builder+ or +activesupport+ gem installed before continuing. CI::Reporter will raise an exception at runtime if it cannot locate Builder.
== Installation
@@ -18,7 +16,7 @@ To use CI::Reporter as a Rails plugin, first install the gem, and then install t
== Usage
-CI::Reporter works best with projects that use a +Rakefile+ along with the standard <code>Rake::TestTask</code> or <code>Spec::Rake::SpecTask</code> tasks for running tests or specs, respectively. In this fashion, it hooks into <code>Test::Unit</code> or +RSpec+ using environment variables recognized by these custom tasks to inject the CI::Reporter code into the test or spec runs. If you're using the Rails plugin, step 1 is unnecessary; skip to step 2.
+CI::Reporter works best with projects that use a +Rakefile+ along with the standard <code>Rake::TestTask</code> or <code>Spec::Rake::SpecTask</code> tasks for running tests or examples, respectively. In this fashion, it hooks into <code>Test::Unit</code> or +RSpec+ using environment variables recognized by these custom tasks to inject the CI::Reporter code into the test or spec runs. If you're using the Rails plugin, step 1 is unnecessary; skip to step 2.
1. To use CI::Reporter, simply add the following lines to your Rakefile:
@@ -49,6 +47,12 @@ There's a bit of a chicken and egg problem because rubygems needs to be loaded b
* +CI_REPORTS+: if set, points to a directory where report files will be written.
* +CI_CAPTURE+: if set to value "off", stdout/stderr capture will be disabled.
+== Source
+
+CI::Reporter source is not currently located in Rubyforge's SVN. To get the source:
+
+ svn co http://svn.caldersphere.net/svn/main/rubyforge/ci_reporter/trunk ci_reporter
+
== License
This software is released under an MIT license. For details, see the LICENSE.txt file included with the distribution. The software is copyright (c) 2006-2007 Nick Sieger <nicksieger@gmail.com>.
View
2 Rakefile
@@ -5,7 +5,7 @@ MANIFEST = FileList["History.txt", "Manifest.txt", "README.txt", "LICENSE.txt",
begin
require 'hoe'
- hoe = Hoe.new("ci_reporter", "1.3.2") do |p|
+ hoe = Hoe.new("ci_reporter", "1.3.3") do |p|
p.rubyforge_name = "caldersphere"
p.url = "http://caldersphere.rubyforge.org/ci_reporter"
p.author = "Nick Sieger"
View
9 lib/ci/reporter/rake/rspec.rb
@@ -6,9 +6,14 @@
namespace :setup do
task :rspec do
rm_rf ENV["CI_REPORTS"] || "spec/reports"
+
+ spec_opts = ["--require", "#{File.dirname(__FILE__)}/rspec_loader.rb",
+ "--format", "CI::Reporter::RSpec"].join(" ")
+ ENV["SPEC_OPTS"] ||= ""
+ ENV["SPEC_OPTS"] += spec_opts
+ # Pre RSpec 1.0.6
ENV["RSPECOPTS"] ||= ""
- ENV["RSPECOPTS"] += [" --require", "#{File.dirname(__FILE__)}/rspec_loader.rb",
- "--format", "CI::Reporter::RSpec"].join(" ")
+ ENV["RSPECOPTS"] += spec_opts
end
end
end
View
14 spec/ci/reporter/rake/rake_tasks_spec.rb
@@ -46,23 +46,23 @@ def restore_env(v)
Rake.application = @rake
load CI_REPORTER_LIB + '/ci/reporter/rake/rspec.rb'
save_env "CI_REPORTS"
- save_env "RSPECOPTS"
+ save_env "SPEC_OPTS"
ENV["CI_REPORTS"] = "some-bogus-nonexistent-directory-that-wont-fail-rm_rf"
end
after(:each) do
- restore_env "RSPECOPTS"
+ restore_env "SPEC_OPTS"
restore_env "CI_REPORTS"
Rake.application = nil
end
- it "should set ENV['RSPECOPTS'] to include rspec formatter args" do
+ it "should set ENV['SPEC_OPTS'] to include rspec formatter args" do
@rake["ci:setup:rspec"].invoke
- ENV["RSPECOPTS"].should =~ /--require.*rspec_loader.*--format.*CI::Reporter::RSpec/
+ ENV["SPEC_OPTS"].should =~ /--require.*rspec_loader.*--format.*CI::Reporter::RSpec/
end
- it "should append to ENV['RSPECOPTS'] if it already contains a value" do
- ENV["RSPECOPTS"] = "somevalue".freeze
+ it "should append to ENV['SPEC_OPTS'] if it already contains a value" do
+ ENV["SPEC_OPTS"] = "somevalue".freeze
@rake["ci:setup:rspec"].invoke
- ENV["RSPECOPTS"].should =~ /somevalue.*--require.*rspec_loader.*--format.*CI::Reporter::RSpec/
+ ENV["SPEC_OPTS"].should =~ /somevalue.*--require.*rspec_loader.*--format.*CI::Reporter::RSpec/
end
end

0 comments on commit 172f0a1

Please sign in to comment.
Something went wrong with that request. Please try again.