Geminstaller C0 Coverage Information - RCov

lib/geminstaller/gem_interaction_handler.rb

Name Total Lines Lines of Code Total Coverage Code Coverage
lib/geminstaller/gem_interaction_handler.rb 41 35
34.15%
25.71%

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 GemInteractionHandler
3     attr_writer :dependent_gem, :noninteractive_chooser_class, :valid_platform_selector
4     DEPENDENCY_PROMPT = 'Install required dependency'
5     
6     def initialize
7       check_rubygems_version
8     end
9     
10     def handle_ask_yes_no(question)
11       return unless question.index(DEPENDENCY_PROMPT)
12       message = "Error: RubyGems is prompting to install a required dependency, and you have not " +
13                 "specified the '--install-dependencies' option for the current gem.  You must modify your " +
14                 "geminstaller config file to either specify the '--install-depencencies' (-y) " +
15                 "option, or explicitly add an entry for the dependency gem earlier in the file.\n"
16       raise GemInstaller::UnauthorizedDependencyPromptError.new(message)
17     end
18     
19     def handle_choose_from_list(question, list, noninteractive_chooser = nil)
20       noninteractive_chooser ||= @noninteractive_chooser_class.new
21       valid_platforms = nil
22       if dependent_gem_with_platform_specified?(list, noninteractive_chooser) or noninteractive_chooser.uninstall_list_type?(question)
23         valid_platforms = [@dependent_gem.platform]
24       else
25         valid_platforms = @valid_platform_selector.select(@dependent_gem.platform)
26       end
27       noninteractive_chooser.choose(question, list, @dependent_gem.name, @dependent_gem.version, valid_platforms)
28     end
29     
30     def dependent_gem_with_platform_specified?(list, noninteractive_chooser)
31       noninteractive_chooser.dependent_gem?(@dependent_gem.name, list) and @dependent_gem.platform
32     end
33   
34     def check_rubygems_version
35       if GemInstaller::RubyGemsVersionChecker.matches?('>=0.9.5')
36         # gem_interaction_handler is not used for RubyGems >= 0.9.5
37         raise RuntimeError.new("Internal GemInstaller Error: GemInteractionHandler should not be used for RubyGems >= 0.9.5")
38       end
39     end
40   end
41 end

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