0

I have a simple ruby file that returns the largest integer, which has corresponding spec file which, I believe, should go through different part of the code.However, in RubyMine, using simplecove gen, it is reporting only 28.57 % covered ( 7 relevant lines. 2 lines covered and 5 lines missed. ).

Could you please help me understand why my tests are missing these (5) lines.

Thanks for your help

Anand
  • 113
  • 1
  • 9
  • How are you running the tests? – Zach Kemp Mar 19 '14 at 16:58
  • Hi Zach , I used Ruby Mine IDE to run the code coverage report. I run the rspec from the IDE as well , which all passed. – Anand Mar 19 '14 at 17:04
  • I'm not really familiar with how RubyMine runs tests, but it sounds like it is running them all individually instead of as a suite (plus, in my experience, SimpleCov can be incredibly picky about how the test environment is setup). Have you read [RubyMine's page on SimpleCov setup](http://www.jetbrains.com/ruby/webhelp/code-coverage.html)? – Zach Kemp Mar 19 '14 at 17:23
  • Hi Zach,Thank you for the pointer. I tried running rspec from cmd line`ani:Algorithms/ (master*) $ rspec features/largest_integer_spec.rb [18:31:02] .... Finished in 0.00178 seconds 4 examples, 0 failures Coverage report generated for RSpec to /Users/ani/RubymineProjects/Algorithms/coverage. 7 / 7 LOC (100.0%) covered.` Found that worked. Now I need to debug the integration/settings with Ruby mine. – Anand Mar 20 '14 at 01:40

0 Answers0