Geminstaller C0 Coverage Information - RCov

spec/unit/source_index_search_adapter_spec.rb

Name Total Lines Lines of Code Total Coverage Code Coverage
spec/unit/source_index_search_adapter_spec.rb 32 27
65.62%
62.96%

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 SourceIndexSearchAdapter instance" do
5   before(:each) do
6     @source_index_search_adapter = GemInstaller::SourceIndexSearchAdapter.new
7     @mock_gem_source_index_proxy = mock("Mock Gem Source Index Proxy")
8     @source_index_search_adapter.gem_source_index_proxy = @mock_gem_source_index_proxy
9     @sample_gem = sample_gem
10   end
11 
12   if GemInstaller::RubyGemsVersionChecker.matches?('<=0.9.4')
13   it "passes gem_pattern regexp and version_requirement for RubyGems <= 0.9.4" do
14     @mock_gem_source_index_proxy.should_receive(:refresh!)
15     @mock_gem_source_index_proxy.should_receive(:search).with(/^#{@sample_gem.regexp_escaped_name}$/, @sample_gem.version)
16     @source_index_search_adapter.search(@sample_gem, @sample_gem.version)
17   end
18 
19   it "passes empty string pattern and default version when all_local_specs is called for RubyGems <= 0.9.4" do
20     @mock_gem_source_index_proxy.should_receive(:refresh!)
21     @mock_gem_source_index_proxy.should_receive(:search).with('', GemInstaller::RubyGem.default_version)
22     @source_index_search_adapter.all_local_specs
23   end
24   else
25   it "raises a GemInstaller error if Gem::Dependency.new fails" do
26     Gem::Dependency.should_receive(:new).and_raise(ArgumentError)
27     lambda { @source_index_search_adapter.search(@sample_gem,@sample_gem.version) }.should raise_error(GemInstaller::GemInstallerError)
28   end
29   end
30 
31 end
32 

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