[rspec-users] RSpec2 issue with RCov

David Chelimsky dchelimsky at gmail.com
Tue Dec 28 20:34:18 EST 2010


On Tue, Dec 28, 2010 at 3:01 PM, Tiago Fernandez
<tiago.fernandez at gmail.com> wrote:
> Hello,
> 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
>       end
>
>       RSpec::Core::RakeTask.new(:coverage) do |t|
>         t.rcov = true
>         t.rcov_opts =  %q[--exclude "spec"]
>         t.verbose = true
>       end
>     end
> When running test:coverage, I get this:
>     ./spec/foo_spec.rb:3: undefined method `describe' for main:Object
> (NoMethodError)
>      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:
> https://github.com/tiagofernandez/codekatas/tree/master/matchmaker
> Any idea?

require "rspec" :)

> Thanks in advance.
> Tiago Fernandez
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>


More information about the rspec-users mailing list