[rspec-users] Problems with RCov and Rails

Scott Taylor mailing_lists at railsnewbie.com
Sat Jun 16 12:59:22 EDT 2007


Why not use the the built in task, rake spec:rcov ?

Scott


On Jun 15, 2007, at 7:03 AM, Ian Leitch wrote:

> Hey list,
>
> I'm trying to use the rcov integration that rspec provides in my Rails
> application. As per the  documentation on the website, I've created
> the following rake task:
>
> lib/tasks/specs_with_rcov.rake:
>
> require 'spec/rake/spectask'
>
> desc "Run all specs with rcov"
> Spec::Rake::SpecTask.new('specs_with_rcov') do |t|
>   t.rcov = true
> end
>
> However...
>
> $ rake specs_with_rcov
> (in /Users/ian/Projects/systino/trunk)
> rake aborted!
> superclass mismatch for class Annotation
> /Users/ian/Projects/systino/trunk/rakefile:10
> (See full trace by running task with --trace)
>
> =======
>
> $ rake specs_with_rcov --trace
> (in /Users/ian/Projects/systino/trunk)
> rake aborted!
> superclass mismatch for class Annotation
> /Users/ian/Projects/systino/trunk/vendor/rails/railties/lib/tasks/ 
> annotations.rake:2
> /Users/ian/Projects/systino/trunk/vendor/rails/railties/lib/tasks/ 
> rails.rb:4:in
> `load'
> /Users/ian/Projects/systino/trunk/vendor/rails/railties/lib/tasks/ 
> rails.rb:4
> /Users/ian/Projects/systino/trunk/vendor/rails/railties/lib/tasks/ 
> rails.rb:4:in
> `each'
> /Users/ian/Projects/systino/trunk/vendor/rails/railties/lib/tasks/ 
> rails.rb:4
> /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in
> `gem_original_require'
> /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in  
> `require'
> /Users/ian/Projects/systino/trunk/rakefile:10
> /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1940:in  
> `load'
> /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1940:in
> `raw_load_rakefile'
> /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1727:in  
> `load_rakefile'
> /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1761:in
> `standard_exception_handling'
> /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1726:in  
> `load_rakefile'
> /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1710:in `run'
> /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1761:in
> `standard_exception_handling'
> /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1708:in `run'
> /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/bin/rake:7
> /usr/local/bin/rake:16:in `load'
> /usr/local/bin/rake:16
>
> =======
>
> The Annotation class inherits a Struct instance which I thought may be
> conflicting with a Struct class provided by RSpec, however it doesn't,
> nor does RSpec contain an Annotation class. I'm afraid this bug is
> beyond me. Has anyone else seen it?
>
> $ script/about
> About your application's environment
> Ruby version                 1.8.6 (powerpc-darwin8.9.0)
> RubyGems version             0.9.4
> Rails version                1.2.3
> Active Record version        1.15.3
> Action Pack version          1.13.3
> Action Web Service version   1.2.3
> Action Mailer version        1.3.3
> Active Support version       1.4.2
> Edge Rails revision          184
> Application root             /Users/ian/Projects/systino/trunk
> Environment                  development
> Database adapter             mysql
> Database schema version      26
>
> Cheers
> Ian
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users



More information about the rspec-users mailing list