Geminstaller C0 Coverage Information - RCov

spec/functional/gem_list_checker_spec.rb

Name Total Lines Lines of Code Total Coverage Code Coverage
spec/functional/gem_list_checker_spec.rb 68 56
95.59%
94.64%

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 dir = File.dirname(__FILE__)
2 require File.expand_path("#{dir}/../helper/spec_helper")
3 
4 describe "a GemListChecker instance" do
5   before(:each) do
6     GemInstaller::TestGemHome.use
7     
8     @registry = GemInstaller.create_registry
9     @gem_list_checker = @registry.gem_list_checker
10     @sample_gem = sample_gem
11   end
12 
13   it "should properly specify default platform if platform is unspecified" do
14     @sample_gem.platform = nil
15     should_not_raise_error    
16   end
17 
18   it "should properly specify highest version if version is unspecified" do
19     @sample_gem.version = GemInstaller::RubyGem.default_version
20     should_not_raise_error    
21   end
22 
23   it "should properly specify with a binary platform" do
24     @sample_gem.name = "stubgem-multiplatform"
25     @sample_gem.version = "1.0.1"
26     if GemInstaller::RubyGemsVersionChecker.matches?('>=0.9.5')
27       @sample_gem.platform = Gem::Platform.new('mswin32')
28     else
29       @sample_gem.platform = Gem::Platform::WIN32
30     end
31     should_not_raise_error    
32   end
33 
34   it "should properly specify with a ruby platform even though binary platforms exist" do
35     @sample_gem.name = "stubgem-multiplatform"
36     @sample_gem.platform = "ruby"
37     should_not_raise_error    
38   end
39 
40   it "should properly specify with a non-exact version" do
41     @sample_gem.name = "stubgem-multiplatform"
42     @sample_gem.version = "> 0.0.0"
43     @sample_gem.platform = "ruby"
44     should_not_raise_error
45     @sample_gem.version.should=="1.0.1"
46   end
47   
48   it "should raise error from verify_and_specify_remote_gem! if there is no match found" do
49     @sample_gem.name = "bogusname"
50     should raise_error
51   end
52   
53   after(:each) do
54     GemInstaller::TestGemHome.uninstall_all_test_gems
55   end
56 
57   def should raise_error
58     lambda { invoke_method }.should raise_error(GemInstaller::GemInstallerError)
59   end
60   
61   def should_not_raise_error
62     invoke_method
63   end
64   
65   def invoke_method
66     @gem_list_checker.verify_and_specify_remote_gem!(@sample_gem)
67   end
68 end

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