I’m currently evaluating jruby, but before moving my production code
from Windows/MRI to jruby, I would need my usual BDD tools
(cucumber/spec) and coverage tools (rcov) to work together well.
It’s unfortunately not the case with jruby-1.5.x, when apparently this
works with jruby-1.4.1. Here’s my testcase:
git clone git://github.com/cmichon/calculator.git
on a fresh jruby-1.5.x (I of course tried 1.5.5 today), install the
following gems: gherkin, rcov, cucumber
in the calculator subdirectory, just launch ‘rake’ and observe the
low coverage
In the coverage subdirectory (it’s a html report), I should get 100%
on all 4 files. I do not get this with any jruby-1.5.x, whereas with
jruby-1.4.x or windows MRI 1.8/1.9 it works fine.
I tried this on windows and linux/ubuntu, so I would classify this as
a regression versus jruby-1.4.1.
I would like to know if someone has already met this issue and maybe had
a fix ?
If you read carefully my email, I shared the testcase. I can send you
a more detailed email with screenshots etc… Just let me know.
I did see your test case and was asking for the screen shots (or your
coverage directory) I am running on a mac so if it’s the issue I
referred to above I will get different results. Are you using all the
latest for gherkin cucumber and rcov?
I’ll go install those and try.
If you read carefully my email, I shared the testcase. I can send you
a more detailed email with screenshots etc… Just let me know.
I did see your test case and was asking for the screen shots (or your
coverage directory) I am running on a mac so if it’s the issue I
referred to above I will get different results. Are you using all the
latest for gherkin cucumber and rcov?
I’ll go install those and try.
The coverage figures should do (attaching pictures might break the
attachment policy of this mailing list):
27.50% features/step_definitions/calculator_steps.rb
50.00% features/support/env.rb
35.29% lib/calculator.rb
100.00% spec/calculator_spec.rb
41.67% TOTAL
On Fri, Nov 19, 2010 at 1:04 PM, Jay McGaffigan [email protected]
wrote:
Christian,
I ran specs and rcov and it indeed looks like the fix I pointed to you
should fix the issue you are seeing.
cool! thanks a lot…
in your test case if you open all your files with something like
textpad and convert the format to unix you should see your coverage go
up (I’m not saying this is the solution you should be using but more
as another check)
I see. I’ll change my autofile settings in vim to make sure all *.rb,
*.feature, *.spec end up in unix format then.
I’ll update jira accordingly. Too bad this will wait for jruby-1.6,
but at least it’s a very good start for me again.
I can migrate my production code to jruby-1.5.5 and trust the code
coverage now
I ran specs and rcov and it indeed looks like the fix I pointed to you
should fix the issue you are seeing.
in your test case if you open all your files with something like
textpad and convert the format to unix you should see your coverage go
up (I’m not saying this is the solution you should be using but more
as another check)
Jay
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.