1

when i issue following command

 jruby -S rspec

It run with following warning

C:/jruby-1.7.4/lib/ruby/gems/shared/gems/simplecov-0.7.1/lib/simplecov.rb:34 warning: tracing (e.g. set_trace_func) will not capture all events without --debug flag

So here my question is how to use this --debug option while running rspec

Kanti
  • 1,062
  • 1
  • 10
  • 27

2 Answers2

0

I'm running simplecov (0.8.2) with JRuby 1.7.11 and I'm not having an issue. Here's my setup:

.rspec:

 --format documentation
 --color

In the spec_helper.rb:

require 'simplecov'
SimpleCov.start 'rails'

Whether I run the default rake task with:

jruby -S bundle exec rake

Or run rspec as you did, I get the debug warning. However simplecov still actually works just fine. I can see the coverage of the various files.

agmcleod
  • 13,321
  • 13
  • 57
  • 96
  • Yeah i seem to be getting that as well on my views. Interesting. The views do look covered just fine, as I have a fair number of integration tests. – agmcleod Aug 01 '14 at 11:43
0

I think I have got the solution: When I executing rspec without --debug option

jruby -S rspec

It give me coverage of 97.8%

And with --debug

jruby --debug -S rspec

It give me coverage of 98.46%

And I have also confirmed with ruby using

bundle exec rspec

It give me coverage result 98.36%

So I think using --debug option is better option.

If you don't want warning like Warning: coverage data provided by Coverage [7] exceeds number of lines

Then you can add following lines to simplecov config block

SimpleCov.start 'rails' do
  add_filter 'app/views'
end
Kanti
  • 1,062
  • 1
  • 10
  • 27