2010-07-15 2 views
2

Rails 3 애플리케이션에서 metric_fu를 실행하려고합니다. rcov를 제외한 모든 것이 좋습니다. 나는 RSpec을 설정했고 나의 테스트는 spec/**/*. rb 형식을 따르고 RSpec에서 잘 돌아 간다.Metric Fu : RCov가 spec_helper를로드하지 못합니다.

** 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\[email protected]\/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/[email protected]/gems/rcov-0.9.8/bin/rcov:511:in `load' 
    from /Users/Eric/.rvm/gems/[email protected]/gems/rcov-0.9.8/bin/rcov:511 
    from /Users/Eric/.rvm/gems/[email protected]/bin/rcov:19:in `load' 
    from /Users/Eric/.rvm/gems/[email protected]/bin/rcov:19 

내가 rcov 직접 실행, 문제의 부품이 올바르게으로 요구되는 내 사양의 spec_helper를로드하지 rcov되어 나타납니다 그러나, rcov와 범위를 확인하려고, 나는 다음과 같은 오류를 얻을 수 "require 'spec_helper'".

해결 방법에 대한 도움이 필요하십니까? 감사.

답변

0

"-Ispec"을 Metric-Fu 구성에 추가하면이 문제가 해결됩니다.

관련 문제