views:

21

answers:

0

I use rcov 0.9.8 on ruby 1.9.1 and rvm for ROR application. Rcov has problem on ruby 1.9. I found solution for encoding problems from here.

--- lib/rcov/code_coverage_analyzer.rb~ 2010-03-21 16:15:47.000000000 +0100
+++ lib/rcov/code_coverage_analyzer.rb  2010-03-21 16:11:49.000000000 +0100
@@ -250,6 +250,10 @@
     end

     def update_script_lines__
+      if '1.9'.respond_to?(:force_encoding)
+        SCRIPT_LINES__.each{|k,v| v.each{|src| src.try(:force_encoding, 'utf-8')}}
+      end
+
       @script_lines__ = @script_lines__.merge(SCRIPT_LINES__)
     end

But I want to overwrite method with loading custom file. Rcov does not have require option. Any ideas?