Geminstaller C0 Coverage Information - RCov

lib/geminstaller/rubygems_version_checker.rb

Name Total Lines Lines of Code Total Coverage Code Coverage
lib/geminstaller/rubygems_version_checker.rb 21 14
85.71%
78.57%

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 RubyGemsVersionChecker
3     def self.matches?(version_spec, options = {})
4       version_spec = [version_spec] unless version_spec.kind_of?(Array)
5       # TODO: if rubygems has already been initialized before GemInstaller overrides the rubygems version,
6       # (for example, by running rspec), then Gem::RubyGemsVersion could be initialized to the incorrect
7       # system-rubygems version instead of the geminstaller-overridden version.  Need to figure out how
8       # to re-parse 'rubygems/rubygems_version' and let it redefine 'Gem::RubyGemsVersion'
9       rubygems_version = options[:rubygems_version] ||= Gem::RubyGemsVersion
10       
11       # Manually check here in addition to backward_compatibility.rb, to avoid circular dependency
12       if defined?(Gem::Requirement)
13         requirement_class = Gem::Requirement
14       else
15         requirement_class = Gem::Version::Requirement
16       end
17       
18       requirement_class.new(version_spec).satisfied_by?(Gem::Version.new(rubygems_version))
19     end
20   end
21 end

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