Getting a deprecation warning:
DEPRECATION WARNING: you are using a deprecated constant that will
be removed from a future version of RSpec.
* Spec is deprecated.
* RSpec is the new top-level module in RSpec-2
And then an error:
/var/lib/hudson/.rvm/gems/ruby-1.9.2-preview3/gems/ci_reporter-1.6.2/lib/ci/reporter/rspec.rb:42:in `<module:Reporter>': uninitialized constant RSpec::Runner (NameError)
from /var/lib/hudson/.rvm/gems/ruby-1.9.2-preview3/gems/ci_reporter-1.6.2/lib/ci/reporter/rspec.rb:21:in `<module:CI>'
from /var/lib/hudson/.rvm/gems/ruby-1.9.2-preview3/gems/ci_reporter-1.6.2/lib/ci/reporter/rspec.rb:20:in `<top (required)>'
Confirm. Will need to introduce new logic for RSpec 2.
Is there any plan to release a beta compatible with rspec 2 beta? I've seen that netoisstools has changed rspec.rb for rspec 2 compatibility: http://github.com/netoisstools/ci_reporter/commit/918bd95f8297f4e59787deab91bacecf78172f61
does not work with Rails 3.0.0 and RSpec 2.0.0.beta.3 Fails with message :
/home/userX/.rvm/gems/ruby-1.9.2-p0/gems/ci_reporter-1.6.2/lib/ci/reporter/rspec.rb:42:in <module:Reporter>': uninitialized constant RSpec::Runner (NameError)
from /home/userX/.rvm/gems/ruby-1.9.2-p0/gems/ci_reporter-1.6.2/lib/ci/reporter/rspec.rb:20:in `'
<module:Reporter>': uninitialized constant RSpec::Runner (NameError)
Here's a diff that makes it work with rspec 2.0. Nick, I'm sure there's a way to integrate this while maintaining backwards compatibility with the old rspec but I haven't looked into that.
diff --git a/lib/ci/reporter/rspec.rb b/lib/ci/reporter/rspec.rb
index e45a67a..aaec487 100644
@@ -6,8 +6,8 @@ require 'ci/reporter/core'
tried_gem = false
- require 'spec/runner/formatter/progress_bar_formatter'
- require 'spec/runner/formatter/specdoc_formatter'
+ require 'spec/core/formatters/progress_formatter'
+ require 'spec/core/formatters/base_formatter'
tried_gem = true
@@ -39,17 +39,18 @@ module CI
# Custom +RSpec+ formatter used to hook into the spec runs and capture resu
- class RSpec < Spec::Runner::Formatter::BaseFormatter
+ class RSpec < Spec::Core::Formatters::BaseFormatter
- @formatter ||= Spec::Runner::Formatter::ProgressBarFormatter.new(*args)
+ @formatter ||= Spec::Core::Formatters::ProgressFormatter.new(*args)
@report_manager = ReportManager.new("spec")
@suite = nil
+ @start = Time.now
@@ -140,7 +141,7 @@ module CI
class RSpecDoc < RSpec
- @formatter = Spec::Runner::Formatter::SpecdocFormatter.new(*args)
+ @formatter = Spec::Core::Formatters::SpecdocFormatter.new(*args)
Apparently there's more to this than just fixing the requires and constant names. I haven't been able to get any of the half-dozen or so forks to work properly. Eagerly awaiting official support.
Yes, there were a few more things that needed to be fixed in order to get it running with rspec-rails 2.0.0.beta.19. I created a fork with the changes that work for me.
The fork also includes some fixes from another user running beta22.
I tried your fork but got this error: http://gist.github.com/599530
Looks like http://github.com/tylerkovacs/ci_reporter/commit/12d5760947fd50071e86f4b02d22f29a404e4380 resolves that.
Thanks Tyler, I recommend your fork for anyone else who needs RSpec 2 compatibility.
Great, I'm glad it worked for you John.
Aaaand... it broke again with RSpec 2 RC.
ci/reporter/rspec.rb:42: uninitialized constant RSpec::Core::Formatters (NameError)
Looks like it now needs an explicit require:
Thanks John, I just pushed a fix for rspec2 final.
This is fixed in trunk and will go out in 1.6.3.