Hello all,
I'm trying to use metric-fu in my project, and have done these steps:
- Installed gem
- Added "require 'metric_fu'" to Rakefile
- Added "config.gem 'jscruggs-metric_fu', :version => '1.0.2', :lib =>
'metric_fu', :source => '
http://gems.github.com'" to environments/
test.rb
When I run "rake metrics:all", I receive this error:
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\.8\.1\.2\.0\/lib\/rcov
\/report\.rb\z/,
/\bvendor\//,
/\bconfig\//,
/\benvironment\//,
/\/gems\//,
/\/Library\//,
/spec/]
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/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in
`gem_original_require': no such file to load -- test_helper
(LoadError)
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in
`require'
from ./test/functional/accounts_controller_test.rb:1
from /usr/lib/ruby/gems/1.8/gems/rcov-0.8.1.2.0/bin/rcov:554:in
`load'
from /usr/lib/ruby/gems/1.8/gems/rcov-0.8.1.2.0/bin/rcov:554
from /usr/bin/rcov:19:in `load'
from /usr/bin/rcov:19
rake aborted!
NaN
I suppose it may not be finding my test files, because it looks like
is searching for test/test_*.rb , and my tests are *_test.rb.
I have tried to set the options on Rakefile so rcov searches the right
test files, but I still got the same error.
Any advices?