I installed the rcov gem and it installed just fine but when I try and
run:
rcov test/unit/*.rb
I get:
No file to analyze was found. All the files loaded by rcov matched one
of the
following expressions, and were thus ignored:
[/\A/usr/lib/,
/\btc_[^.]*.rb/,
/_test.rb\z/,
/\btest//,
/\bvendor//,
/\A/usr/lib/ruby/gems/1.8/gems/rcov-0.9.6/lib/rcov/formatters/base_formatter.rb\z/]
You can solve this by doing one or more of the following:
- rename the files not to be ignored so they don’t match the above
regexps - use --include-file to give a list of patterns for files not to be
ignored - use --exclude-only to give the new list of regexps to match against
- structure your code as follows:
test/test_.rb for the test cases
lib/**/.rb for the target source code whose coverage you want
making sure that the test/test_.rb files are loading from lib/, e.g.
by
using the -Ilib command-line argument, adding
$:.unshift File.join(File.dirname(FILE), “…”, “lib”)
to test/test_.rb, or running rcov via a Rakefile (read the RDoc
documentation or README.rake in the source distribution).
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
gem_original_require': no such file to load -- test_helper (LoadError) from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:inrequire’
from ./test/unit/classified_resource_test.rb:1
from /usr/lib/ruby/gems/1.8/gems/rcov-0.9.6/bin/rcov:508:in
load' from /usr/lib/ruby/gems/1.8/gems/rcov-0.9.6/bin/rcov:508 from /usr/bin/rcov:19:inload’
from /usr/bin/rcov:19
Same thing if I try to run it on a specified unit test.
I thought it should work on rails out of the box but apparently not.
Anyone know what else you need to do? Their web
(eigenclass.org) page has no info regarding the
matter.