Ruby test coverage tool - ruby-on-rails

I need a tool which measures test coverage under Ruby.
I tried rcov, but couldn't install it under Windows, Cygwin, or Ubuntu.
Which programs (not necessarily free) calculate the branch and/or line coverage of tests in Ruby and work with Ruby on Rails?

Simplecov. Rcov doesn't work so well under Ruby 1.9.*, but simplecov does.

You also have deep-cover which aims to be more complete than the mentioned examples.
From the Readme:
Deep Cover aims to be the best coverage tool for Ruby code:
more accurate line coverage
branch coverage
can be used as a drop-in replacement for the built-in Coverage library.

Use Ruby's built in Coverage feature if you are wanting something very simple. It is what Simplecov uses under the hood.

Related

Does dart have a testing framework similar to Javascript's Jasmine?

Is there any test framework in Dart that is as robust as Jasmine
I did use pub test, but it is made me wanting something like Javascript's Jasmine.
Any suggestions?
The test package that you used is as robust as Jasmine. It is backed by tests, can run tests on multiple platforms (VM/server, browsers, Flutter), allows tagging, skipping, grouping, filtering by name, and more.
In what areas do you feel that Jasmine is more robust?

Testing code coverage for jRuby

Just out of interest, are there any easy to setup and work with code coverage tools for jRuby-1.5.3 and jRuby-1.6.5:
Testing coverage (C0, C1, C2)
Performance (Memory use, memory leaking)
Best practices
That would be a great idea to write down your thought, as I'm trying to break through this for almost a week.
Thank you.
To question #1, so far as I know, code coverage for JRuby 1.6.x running in 1.9 mode is blocked on this open defect: JRuby 6106
If you're running in 1.8 mode, you should be able to use the rcov gem.

Finding out rails' test coverage

I've just seen this issue on rails' issue tracker:
https://github.com/rails/rails/issues/2667
And I'd like to find out which parts of the code aren't covered. I couldn't find a coverage tool into the Rakefiles, and searching for it is a bit frustrating, since it returns far more results about test coverage on your rails app than test coverage of the framework itself.
Has anybody set up a code coverage tool? Is there any documentation on how to do it?
Rcov (or SimpleCov for 1.9) is the standard tool for Ruby code coverage. It should be fairly straightforward to get one of these to run the rails tests.

Good alternative for ant for use on jenkins build server

Hy there. I have a number of software projects (also iOS and OSX) which I build with Apache ant`.
Although I quite like Ant it is often too verbose and some things which should be easy are quite tricky or I have to use shell scripts along with ant.
Is there a good alternative for which is extensible, easy to use and should work well on my jenkins build server.
Thanks for your input.
Have a look at Gradle - it's quite different from Ant and may take a little while to get your head around, but I think it's going to be the new standard for build systems. One nice thing is that it has full Ant support under the hood, so you can easily get your existing Ant builds running and then port them to Gradle.
Gareth's answer of Gradle is a good one. But do take a look at what you are doing that is hard with Ant. In my experience, a fair portion of the time its "non-build" stuff. Perhaps leave Ant for the pure build stuff, and use an alternate tool for and deploy or test stuff that's snuck in there.
Although gradle looks very promising I decided to use Rake instead.
I should say that this is a biased decision since I am already using ruby for other parts in my build setup. I found a good Article by Martin Fowler
Another point is that by doing OSX development the platform-independence-aspect of Ant (or Gradle) does not have such a big weight for me.
BTW Besi's Rake answer:
JRuby's Rake+Ant integration seems like a really powerful combo:
http://www.engineyard.com/blog/2010/rake-and-ant-together-a-pick-it-n-stick-it-approach
One big advantange there, it fully supports integration with Ant, allowing step-by-step migration.. which IMHO is only viable strategy for large, existing projects.
Gradle seems similar and while it looks good; I think learning Rake could be a better investment as it's more universal outside of Java.
(The other thing I'm seriously considering is BuildR http://buildr.apache.org, but Jenkins doens't explicitly support it yet, so have to use scripted build steps, which seems less preferable. TODO: a BuildR plugin).

Cucumber IDE for feature writing with autocomplete?

Is there any Eclipse plugin for writing features for cucumber with autocomplete functionality?
I guess that would be good to find and reuse steps from other features. Any ideas?
The cucumber-eclipse plugin illustrates one possible approach.
As Xtext seems not to be the perfect solution for this special case, it is more like a case study then a working plugin.
Based on XText, it uses the cucumber grammar (as in Gherkin), it uses XText features to produce a full-fledge editor.

Resources