#308 new
Aslak Hellesøy

Remove rcov_dir attribute from Rake task

Reported by Aslak Hellesøy | February 26th, 2008 @ 08:58 AM | in 1.1.5

I want to set this with rcov_opts instead. This makes it possible to override it in Rails project via the spec/rcov.opts file.

Comments and changes to this ticket

  • Economy Size Geek

    Economy Size Geek May 9th, 2008 @ 05:12 PM

    I agree - you could set the rcov_opt by default - in the mean time I had to add a new task file

    Where I had to hard code the value for the directory

    rspec_base = File.expand_path(File.dirname(__FILE__) + '/../../rspec/lib')

    $LOAD_PATH.unshift(rspec_base) if File.exist?(rspec_base)

    require 'spec/rake/spectask'

    require 'spec/translator'

    spec_prereq = File.exist?(File.join(RAILS_ROOT, 'config', 'database.yml')) ? "db:test:prepare" : :noop

    task :noop do

    end

    task :default => :spec

    task :stats => "spec:statsetup"

    desc "Run all specs in spec directory (excluding plugin specs)"

    Spec::Rake::SpecTask.new(:spec => spec_prereq) do |t|

    t.spec_opts = ['--options', "\"#{RAILS_ROOT}/spec/spec.opts\""]

    t.spec_files = FileList['spec/**/*_spec.rb']

    end

    namespace :spec do

    desc "Run all specs in spec directory with RCov (excluding plugin specs)"

    Spec::Rake::SpecTask.new(:rcov) do |t|

    t.spec_opts = ['--options', "\"#{RAILS_ROOT}/spec/spec.opts\""]

    t.spec_files = FileList['spec/**/*_spec.rb']

    t.rcov = true

    puts "Options being passed in #{t.rcov_opts}"

    t.rcov_dir = "metrics/coverage"

    t.rcov_opts = lambda do

    IO.readlines("#{RAILS_ROOT}/spec/rcov.opts").map {|l| l.chomp.split " "}.flatten

    end

    puts "Options being passed in #{t.rcov_opts}"

    end

    end

  • David Chelimsky

    David Chelimsky May 27th, 2008 @ 07:46 AM

      • → Milestone changed from “1.1.4” to “1.1.5”

Please Login or create a free account to add a new comment.

You can update this ticket by sending an email to from your email client. (help)

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Behaviour Driven Development for Ruby.

Shared Ticket Bins

Attachments

Tags