Geminstaller C0 Coverage Information - RCov

spec/functional/gem_spec_manager_spec.rb

Name Total Lines Lines of Code Total Coverage Code Coverage
spec/functional/gem_spec_manager_spec.rb 67 57
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 dir = File.dirname(__FILE__)
2 require File.expand_path("#{dir}/../helper/spec_helper")
3 
4 describe "an GemSpecManager instance" do
5   before(:each) do
6     GemInstaller::TestGemHome.use
7     @sample_gem = sample_gem
8     @sample_multiplatform_gem = sample_multiplatform_gem
9     @sample_multiplatform_gem_ruby = sample_multiplatform_gem_ruby
10     @registry = GemInstaller::create_registry
11     @gem_spec_manager = @registry.gem_spec_manager
12     @gem_command_manager = @registry.gem_command_manager
13   end
14 
15   it "should return true for is_gem_installed? if a gem is installed and false if it is not" do
16     @gem_spec_manager.is_gem_installed?(@sample_gem).should==(false)
17     @gem_command_manager.install_gem(@sample_gem)
18     @gem_spec_manager.is_gem_installed?(@sample_gem).should==(true)
19   end
20 
21   it "can list a local matching gem" do
22     install_gem(@sample_gem)
23     matching_gems = @gem_spec_manager.local_matching_gems(@sample_gem)
24     matching_gems.size.should == 1
25     matching_gems[0].name.should == @sample_gem.name
26   
27     non_matching_gems = @gem_spec_manager.local_matching_gems(@sample_multiplatform_gem)
28     non_matching_gems.size.should == 0
29   end
30   
31   it "should select multiple valid platforms when listing local matching gems with exact_platform_match == false" do
32     gem1 = @sample_multiplatform_gem
33     gem2 = @sample_multiplatform_gem_ruby
34     exact_platform_match = false
35     # fixture_sanity_check
36     gem1.name.should == gem2.name
37     gem1.version.should == gem2.version
38     gem1.platform.should_not == gem2.platform
39     install_gem(gem1)
40     install_gem(gem2)
41     matching_gems = @gem_spec_manager.local_matching_gems(gem1, exact_platform_match)
42     matching_gems.size.should == 2
43   end
44   
45   it "can list all local gems" do
46     gems = [@sample_gem, @sample_multiplatform_gem]
47     gems.each do |gem|
48       install_gem(gem)
49     end
50     all_local_gems = @gem_spec_manager.all_local_gems
51     local_gem_names = all_local_gems.collect do |gem|
52       gem.name
53     end
54     local_gem_versions = all_local_gems.collect do |gem|
55       gem.version
56     end
57     local_gem_names.should include(@sample_gem.name)
58     local_gem_names.should include(@sample_multiplatform_gem.name)
59     local_gem_versions.should include(@sample_gem.version)
60   end
61     
62   after(:each) do
63     GemInstaller::TestGemHome.uninstall_all_test_gems
64   end
65 end
66 
67 

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