Forum: RSpec Cucumber and Rcov

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
James B. (Guest)
on 2008-12-04 05:04
I am now trying to get rcov to work for me, without much success.  I
stole the rake task code from the cucumber site:

desc "Run all features"
task :features => "features:all"
task :features => 'db:test:prepare'
require 'cucumber/rake/task' #I have to add this -mischa

namespace :features do
  Cucumber::Rake::Task.new(:all) do |t|
    t.cucumber_opts = "--format pretty"
  end

  Cucumber::Rake::Task.new(:cruise) do |t|
    t.cucumber_opts = "--format pretty
--out=#{ENV['CC_BUILD_ARTIFACTS']}/features.txt --format html
--out=#{ENV['CC_BUILD_ARTIFACTS']}/features.html"
    t.rcov = true
    t.rcov_opts = %w{--rails --exclude osx\/objc,gems\/,spec\/}
    t.rcov_opts << %[-o "#{ENV['CC_BUILD_ARTIFACTS']}/features_rcov"]
  end

  Cucumber::Rake::Task.new(:rcov) do |t|
    t.rcov = true
    t.rcov_opts = %w{--rails --exclude osx\/objc,gems\/,spec\/}
    t.rcov_opts << %[-o "features_rcov"]
  end
end

To be frank, I haven't a clue about whatever this does.  It seems to
have little in common with other suggested rake tasks for rcov thaat I
have found.

In any case, given a cucumber.rake file containign the foregoing, when I
run $ rake features:rcov I obtain the same results as when I ran the
original rake features task.  I need someone to explain to me how to get
this piece properly configured and working.
Mischa F. (Guest)
on 2008-12-04 05:38
(Received via mailing list)
James,

Maybe you are asking something else...but after you type rake
feature:rcov
there should be a folder in rails root called "features_rcov," which may
solve your problem.

rake features:rcov
open features_rcov/index.html

-Mischa
James B. (Guest)
on 2008-12-04 05:42
Mischa F. wrote:
> James,
>
> Maybe you are asking something else...but after you type rake
> feature:rcov
> there should be a folder in rails root called "features_rcov," which may
> solve your problem.
>
> rake features:rcov
> open features_rcov/index.html
>
> -Mischa

Ahhhhh.... Sometimes I feel so dull.
This topic is locked and can not be replied to.