RCov began to analyze loaded libraries (including Rdoc itself) - when using rvm (Ruby Version Manager)

Context

  • rcov 0.9.8 2010-02-28
  • ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin10.3.0]
  • rvm 0.1.38 Wayne E. Seguin ( wayneeseguin@gmail.com ) [ http://rvm.beginrescueend.com/]
  • Ruby system (rvm usage system): ruby ​​1.8.7 (2010-01-10 patchlevel 249) [i686-darwin10]

Files

The test setup is the β€œlib” folder containing one file that defines the class, the test folders and test / sub_test, with β€œsub_test” containing the only β€œtest_example_lib.rb” and a Rakefile like this:

require 'rcov / rcovtask'

task: default => [: rcov]

desc "RCov"
Rcov :: RcovTask.new do | t |
    t.test_files = FileList ['test / ** / test _ *. rb']
end

Result

#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

Question

RCov ? ( " rvm" ). , Ruby, rvm.

+3
1

rcov:

- /gems/,/Library/,/usr/, spec, lib/tasks

require 'rcov/rcovtask'

task :default => [:rcov]

desc "RCov"
Rcov::RcovTask.new do | t |
    t.test_files = FileList[ 'test/**/test_*.rb' ]
    t.rcov_opts << '--exclude /gems/,/Library/,/usr/,spec,lib/tasks'
end
+3

Source: https://habr.com/ru/post/1749542/


All Articles