Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.ruby > #3095 > unrolled thread

Rakefile and simplecov

Started byMarkus Fischer <markus@fischer.name>
First post2011-04-18 05:58 -0500
Last post2011-04-18 13:48 -0500
Articles 3 — 2 participants

Back to article view | Back to comp.lang.ruby


Contents

  Rakefile and simplecov Markus Fischer <markus@fischer.name> - 2011-04-18 05:58 -0500
    Re: Rakefile and simplecov Steve Klabnik <steve@steveklabnik.com> - 2011-04-18 11:11 -0500
      Re: Rakefile and simplecov Markus Fischer <markus@fischer.name> - 2011-04-18 13:48 -0500

#3095 — Rakefile and simplecov

FromMarkus Fischer <markus@fischer.name>
Date2011-04-18 05:58 -0500
SubjectRakefile and simplecov
Message-ID<4DAC1965.2060507@fischer.name>
Hi,

I've a Rakefile generated by jeweler. It uses rcov default but that 
doesn't properly work with 1.9 (I'm using 1.9.2), so I'd like to enable 
simplecov for my tests. I've used simplecov successfully without a Rakefile.

I added

   gem "simplecov", ">= 0.4.0"

to Gemfile and modified the test task:

require 'rake/testtask'
require 'simplecov'
Rake::TestTask.new(:test) do |test|
   SimpleCov.start do
       add_filter 'test_'
   end
   test.libs << 'lib' << 'test'
   test.pattern = 'test/**/test_*.rb'
   test.verbose = true
end

simplecov is executed, but doesn't record anything:

Coverage report generated for rake  to coverage. 0 / 0 LOC (0.0%) covered.

As far as I can see, simplecov doesn't provide a ready rake task, how 
can I use it in this case? I've gone through the rake documentation but 
didn't spot anything obvious I'm missing.

thanks,
- Markus

[toc] | [next] | [standalone]


#3108

FromSteve Klabnik <steve@steveklabnik.com>
Date2011-04-18 11:11 -0500
Message-ID<BANLkTimY6rseYNdsLZjwqEmNQpNO-UfpBw@mail.gmail.com>
In reply to#3095
[Note:  parts of this message were removed to make it a legal post.]

I'm not super familiar with simplecov, but i just merged a patch that
implements it on one of my projects this morning:

https://github.com/hotsh/rstat.us/commit/3b21c68e20f97de1090c75cbe34d099700e34d65

Hope that helps you? It runs the coverage report on every task, though.

[toc] | [prev] | [next] | [standalone]


#3115

FromMarkus Fischer <markus@fischer.name>
Date2011-04-18 13:48 -0500
Message-ID<4DAC8779.60303@fischer.name>
In reply to#3108
On 18.04.2011 18:11, Steve Klabnik wrote:
> I'm not super familiar with simplecov, but i just merged a patch that
> implements it on one of my projects this morning:
> 
> https://github.com/hotsh/rstat.us/commit/3b21c68e20f97de1090c75cbe34d099700e34d65
> 
> Hope that helps you? It runs the coverage report on every task, though.

Thanks, that helped at least get some result. However the coverage
itself is wrong, it's not 12.8% (80/625 LOC), when the real coverage
(standalone without rake) is 597 / 626 LOC (95.37%).

Without the Rakefile, all I do is

$ cat mylib_simplecov.rb
require 'simplecov'
SimpleCov.start do
    add_filter '_test'
end
require_relative 'mylib_test'

and mylib_test starts with

$ head mylib_test.rb
require 'test/unit'
require_relative 'mylib'

module MylibTests
    class Misc < Test::Unit::TestCase

and that's all and it works.


I thought moving to jeweler and all the other stuff makes things easier,
but currently it made it just harder :/


- Markus

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.ruby


csiph-web