3
컨텍스트 RVM을 사용하는 경우
- rcov 0.9.8 2010-02-28
- 루비 1.8.7 (2009-06- 12 패치 레벨 174) 웨인 E. 세귄 의해 [-는 i686 darwin10.3.0]
- RVM 0.1.38 ([email protected]) http://rvm.beginrescueend.com/]
- 시스템 루비 (RVM 이용 시스템) 루비 1.8.7 (2010- 01-10 패치 레벨 249) [i686-darwin10]
파일
테스트 설정이다 'sub_test'하나 'test_example_lib.rb'를 포함하여 클래스, 폴더 '테스트'와 '테스트/sub_test'을 정의하는 하나의 파일을 포함하는 'lib 디렉토리'폴더 및 이 같은 Rakefile :RCov는 (Rdoc 자체를 포함)로드 libs와 분석 시작 - (루비 버전 관리자)
require 'rcov/rcovtask' task :default => [:rcov] desc "RCov" Rcov::RcovTask.new do | t | t.test_files = FileList[ 'test/**/test_*.rb' ] end
결과
#rake (in /Users/stephan/tmp/rcov_example) rm -r coverage Loaded suite /Users/stephan/.rvm/gems/ruby-1.8.7-p174/bin/rcov Started . Finished in 0.000508 seconds. 1 tests, 2 assertions, 0 failures, 0 errors +----------------------------------------------------+-------+-------+--------+ | File | Lines | LOC | COV | +----------------------------------------------------+-------+-------+--------+ |...ms/rcov-0.9.8/lib/rcov/code_coverage_analyzer.rb | 271 | 156 | 5.1% | |...ems/rcov-0.9.8/lib/rcov/differential_analyzer.rb | 116 | 82 | 9.8% | |lib/example_lib.rb | 16 | 11 | 72.7% | +----------------------------------------------------+-------+-------+--------+ |Total | 403 | 249 | 9.6% | +----------------------------------------------------+-------+-------+--------+ 9.6% 3 file(s) 403 Lines 249 LOC
우수, 감사합니다! – Stephan
나를 위해 일했습니다. 고마워요! –