Geminstaller C0 Coverage Information - RCov

spec/unit/config_spec.rb

Name Total Lines Lines of Code Total Coverage Code Coverage
spec/unit/config_spec.rb 121 109
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 "config YAML containing a single gem" do
5   before(:each) do
6     @yaml_text = <<-STRING_END
7       gems:
8         - name: mygem
9           version: '> 0.1.2.3'
10           platform: ruby
11           install_options: -y
12           check_for_upgrade: true
13           fix_dependencies: false
14           no_autogem: true
15     STRING_END
16     @yaml = YAML.load(@yaml_text)
17     @config = GemInstaller::Config.new(@yaml)
18   end
19 
20   it "should be parsed into a corresponding gem object" do
21     gem = @config.gems[0]
22     gem.name.should==('mygem')
23     gem.version.should==('> 0.1.2.3')
24     gem.platform.should==('ruby')
25     gem.install_options.should==(["-y"])
26     gem.check_for_upgrade.should==(true)
27     gem.fix_dependencies.should==(false)
28     gem.no_autogem.should==(true)
29   end
30 end
31 
32 describe "config YAML with only name and version specified" do
33   before(:each) do
34     @yaml_text = <<-STRING_END
35     # COMMENT 
36     gems:
37       - name: mygem
38         version: '0.1.2.3'
39     STRING_END
40     @yaml = YAML.load(@yaml_text)
41     @config = GemInstaller::Config.new(@yaml)
42   end
43 
44   it "should not raise error on nil platform, install_options, or check_for_upgrade" do
45     gem = @config.gems[0]
46     gem.name.should==('mygem')
47     gem.version.should==('0.1.2.3')
48   end
49 end
50 
51 describe "config YAML containing two gems with the same name but different versions" do
52   before(:each) do
53     @yaml_text = <<-STRING_END
54       gems:
55         - name: mygem
56           version: 1.1
57           install_options: -y
58         - name: mygem
59           version: 1.2
60           install_options: ["-y"]
61     STRING_END
62     @yaml = YAML.load(@yaml_text)
63     @config = GemInstaller::Config.new(@yaml)
64   end
65 
66   it "should be parsed into a corresponding gem objects" do
67     gem = @config.gems[0]
68     gem.name.should==('mygem')
69     gem.version.should==('1.1')
70     gem.install_options.should==(["-y"])
71 
72     gem = @config.gems[1]
73     gem.name.should==('mygem')
74     gem.version.should==('1.2')
75     gem.install_options.should==(["-y"])
76     gem.check_for_upgrade.should==(false)
77   end
78 end
79 
80 describe "config YAML containing default install_options" do
81   before(:each) do
82     @yaml_text = <<-STRING_END
83       defaults:
84           install_options: -y
85           check_for_upgrade: true
86       gems:
87         - name: mygem
88           version: 1.1
89     STRING_END
90     @yaml = YAML.load(@yaml_text)
91     @config = GemInstaller::Config.new(@yaml)
92   end
93 
94   it "should propogate default install_options into gem object" do
95     gem = @config.gems[0]
96     gem.name.should==('mygem')
97     gem.version.should==('1.1')
98     gem.install_options.should==(["-y"])
99     gem.check_for_upgrade.should==(true)
100   end
101 end
102 
103 describe "config YAML containing neither default install_options nor gem-specific install options" do
104   before(:each) do
105     @yaml_text = <<-STRING_END
106       gems:
107         - name: mygem
108           version: 1.1
109     STRING_END
110     @yaml = YAML.load(@yaml_text)
111     @config = GemInstaller::Config.new(@yaml)
112   end
113 
114   it "should have no install_options set on gem object" do
115     gem = @config.gems[0]
116     gem.name.should==('mygem')
117     gem.version.should==('1.1')
118     gem.install_options.should==([])
119     gem.check_for_upgrade.should==(false)
120   end
121 end

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