Geminstaller C0 Coverage Information - RCov

lib/geminstaller/rubygems_version_warnings.rb

Name Total Lines Lines of Code Total Coverage Code Coverage
lib/geminstaller/rubygems_version_warnings.rb 38 35
100.00%
100.00%

Key

Code reported as executed by Ruby looks like this...and this: this line is also marked as covered.Lines considered as run by rcov, but not reported by Ruby, look like this,and this: these lines were inferred by rcov (using simple heuristics).Finally, here's a line marked as not executed.

Coverage Details

1 module GemInstaller
2   class RubyGemsVersionWarnings
3     def self.outdated_warning(options = {})
4       return nil if allow_unsupported?
5       return nil if GemInstaller::RubyGemsVersionChecker.matches?('>=0.9.5', options)
6       return "\n\n----------------------------------------------------------------\n" + 
7                   "WARNING: You are using RubyGems version #{Gem::RubyGemsVersion}.\n" +
8                   "You should update to RubyGems version 1.0.1 or above,\n" +
9                   "because gems created for newer RubyGems versions\n" +
10                   "might be incompatible.\n" +
11                   "To update rubygems (recommended), use 'gem update --system'.\n" +
12                   "----------------------------------------------------------------\n\n"
13     end
14 
15     def self.incompatible_warning(options = {})
16       return nil if allow_unsupported?
17       return nil unless (
18         GemInstaller::RubyGemsVersionChecker.matches?('=0.9.5', options) or
19         GemInstaller::RubyGemsVersionChecker.matches?('=1.1.0', options)
20       )
21       return "\n\n----------------------------------------------------------------\n" + 
22                   "WARNING: You are using RubyGems version #{Gem::RubyGemsVersion}.\n" +
23                   "This version is known to have bugs and/or compatibility issues\n" +
24                   "with GemInstaller.  Update RubyGems, or continue at your risk.\n" +
25                   "To update rubygems (recommended), use 'gem update --system'.\n" +
26                   "----------------------------------------------------------------\n\n"
27     end
28 
29     def self.allow_unsupported?
30       defined? ALLOW_UNSUPPORTED_RUBYGEMS_VERSION
31     end
32     
33     def self.print_warnings(options = {})
34       warnings = [self.outdated_warning, self.incompatible_warning].compact!
35       warnings.each {|warning| print warning}
36     end
37   end
38 end

Generated on Mon May 10 23:40:28 -0700 2010 with rcov 0.9.8