[rspec-users] RSpec2 issue with RCov

Tiago Fernandez tiago.fernandez at gmail.com
Tue Dec 28 16:01:04 EST 2010


I am experiencing an issue with RSpec2, while running RCov. In my Rakefile,
I have a task defined like this:

    namespace :test do
      desc "Run all specs."
      RSpec::Core::RakeTask.new(:spec) do |t|
        t.pattern = 'spec/**/*_spec.rb'
        t.verbose = false

      RSpec::Core::RakeTask.new(:coverage) do |t|
        t.rcov = true
        t.rcov_opts =  %q[--exclude "spec"]
        t.verbose = true

When running test:coverage, I get this:

    ./spec/foo_spec.rb:3: undefined method `describe' for main:Object
     from /Library/Ruby/Gems/1.8/gems/rcov-0.9.9/bin/rcov:516:in `load'
     from /Library/Ruby/Gems/1.8/gems/rcov-0.9.9/bin/rcov:516
     from /usr/bin/rcov:19:in `load'
     from /usr/bin/rcov:19
    rake aborted!
    ruby -S rcov -Ispec:lib --exclude "spec" "./spec/foo_spec.rb" failed

Below my gem list:

    diff-lcs (1.1.2)
    rake (0.8.7)
    rcov (0.9.9)
    rspec (2.3.0)
    rspec-core (2.3.1)
    rspec-expectations (2.3.0)
    rspec-mocks (2.3.0)

And here's the code:

Any idea?

Thanks in advance.
Tiago Fernandez
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20101228/1696cd37/attachment-0001.html>

More information about the rspec-users mailing list