Métrique fu: RCOV ne parvient pas à charger SPEC_HELPER
Question
J'essaie d'exécuter Metric_fu sur une application Rails 3.Tout est bon, à l'exception de RCOV.J'ai RSPEC configuré et mes tests suivent le format SPEC / ** / *. RB et fonctionnent bien dans RSPEC.En essayant de vérifier la couverture avec RCOV, cependant, je reçois les erreurs suivantes:
** Running the specs/tests in the [test] environment
No file to analyze was found. All the files loaded by rcov matched one of the
following expressions, and were thus ignored:
[/\A\/Users\/Eric\/\.rvm\/rubies\/ruby\-1\.8\.7\-p299\/lib/,
/\btc_[^.]*.rb/,
/_test\.rb\z/,
/\btest\//,
/\bvendor\//,
/\A\/Users\/Eric\/\.rvm\/gems\/ruby\-1\.8\.7\-p299@-backend\/gems\/rcov\-0\.9\.8\/lib\/rcov\/formatters\/base_formatter\.rb\z/,
/\bvendor\//,
/\bconfig\//,
/\benvironment\//,
/\/gems\//,
/\/Library\//,
/\/usr\//,
/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).
/Users/Eric/.rvm/rubies/ruby-1.8.7-p299/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- spec_helper (LoadError)
from /Users/Eric/.rvm/rubies/ruby-1.8.7-p299/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from ./spec/models/account_spec.rb:1
from /Users/Eric/.rvm/gems/ruby-1.8.7-p299@backend/gems/rcov-0.9.8/bin/rcov:511:in `load'
from /Users/Eric/.rvm/gems/ruby-1.8.7-p299@backend/gems/rcov-0.9.8/bin/rcov:511
from /Users/Eric/.rvm/gems/ruby-1.8.7-p299@backend/bin/rcov:19:in `load'
from /Users/Eric/.rvm/gems/ruby-1.8.7-p299@backend/bin/rcov:19
Lorsque j'exécute directement RCOV, il apparaît que la partie de la question est de la RCOV ne chargée pas correctement le chargement correctement de SPEC_HELPER dans mes spécifications, qui est requise comme "exiger" SPEC_HELPER "".
Toute aide sur la façon de résoudre ce problème?Merci.
La solution
Ajout "-ispec" à la configuration métrique-fu résoue ceci.
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow