Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add backward compatibility method

  • Loading branch information...
commit 5b0c3bda89cb0a09108a15191495671143cd5640 1 parent 4213455
@nicksieger nicksieger authored
Showing with 11 additions and 3 deletions.
  1. +2 −2 Rakefile
  2. +9 −1 lib/ci/reporter/rspec.rb
View
4 Rakefile
@@ -47,9 +47,9 @@ Spec::Rake::SpecTask.new("spec:rcov") do |t|
end
# so we don't confuse autotest
RCov::VerifyTask.new(:rcov) do |t|
- # Can't get threshold up to 100 until the RSpec < 1.0 compatibility
+ # Can't get threshold up to 100 unless RSpec backwards compatibility
# code is dropped
- t.threshold = 99
+ t.threshold = 98
t.require_exact_threshold = false
end
task "spec:rcov" do
View
10 lib/ci/reporter/rspec.rb
@@ -1,4 +1,4 @@
-# (c) Copyright 2006-2008 Nick Sieger <nicksieger@gmail.com>
+# (c) Copyright 2006-2009 Nick Sieger <nicksieger@gmail.com>
# See the file LICENSE.txt included with the distribution for
# software license details.
@@ -53,11 +53,19 @@ def start(spec_count)
@formatter.start(spec_count)
end
+ # rspec 0.9
def add_behaviour(name)
@formatter.add_behaviour(name)
new_suite(name)
end
+ # Compatibility with rspec < 1.2.4
+ def add_example_group(example_group)
+ @formatter.add_example_group(example_group)
+ new_suite(example_group.description)
+ end
+
+ # rspec >= 1.2.4
def example_group_started(example_group)
@formatter.example_group_started(example_group)
new_suite(example_group.description)
Please sign in to comment.
Something went wrong with that request. Please try again.