diff options
author | pierre-o13 <pierre.ozoux@seedrs.com> | 2013-01-16 14:29:42 +0000 |
---|---|---|
committer | Bryan McLellan <btm@opscode.com> | 2013-07-26 11:26:38 -0700 |
commit | 444ac9ce281af7db6b4e0a3912bdb71c10cced5e (patch) | |
tree | 3affc0512fc32ce7b8682d1f76bd69e9f51f0e24 | |
parent | d41f3a28c0ba7d857dd00f3f853df55c193c93c9 (diff) | |
download | chef-444ac9ce281af7db6b4e0a3912bdb71c10cced5e.tar.gz |
add tests to avoid futur regression
-rw-r--r-- | chef/spec/unit/provider/package/portage_spec.rb | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/chef/spec/unit/provider/package/portage_spec.rb b/chef/spec/unit/provider/package/portage_spec.rb index e963934f4f..f44731b73a 100644 --- a/chef/spec/unit/provider/package/portage_spec.rb +++ b/chef/spec/unit/provider/package/portage_spec.rb @@ -230,6 +230,50 @@ EOF lambda { @provider.candidate_version }.should raise_error(Chef::Exceptions::Package) end + it "should find the candidate_version if a category is specifed and there are category duplicates" do + output = <<EOF +Searching... +[ Results for search key : git ] +[ Applications found : 14 ] + +* app-misc/digitemp [ Masked ] + Latest version available: 3.5.0 + Latest version installed: [ Not Installed ] + Size of files: 261 kB + Homepage: http://www.digitemp.com/ http://www.ibutton.com/ + Description: Temperature logging and reporting using Dallas Semiconductor's iButtons and 1-Wire protocol + License: GPL-2 + +* app-misc/git + Latest version available: 4.3.20 + Latest version installed: [ Not Installed ] + Size of files: 416 kB + Homepage: http://www.gnu.org/software/git/ + Description: GNU Interactive Tools - increase speed and efficiency of most daily task + License: GPL-2 + +* dev-util/git + Latest version available: 1.6.0.6 + Latest version installed: ignore + Size of files: 2,725 kB + Homepage: http://git.or.cz/ + Description: GIT - the stupid content tracker, the revision control system heavily used by the Linux kernel team + License: GPL-2 + +* dev-util/gitosis [ Masked ] + Latest version available: 0.2_p20080825 + Latest version installed: [ Not Installed ] + Size of files: 31 kB + Homepage: http://eagain.net/gitweb/?p=gitosis.git;a=summary + Description: gitosis -- software for hosting git repositories + License: GPL-2 +EOF + + @status = mock("Status", :exitstatus => 0) + @provider = Chef::Provider::Package::Portage.new(@new_resource, @run_context) + @provider.should_receive(:popen4).and_yield(nil, nil, StringIO.new(output), nil).and_return(@status) + @provider.candidate_version.should == "1.6.0.6" + end end describe Chef::Provider::Package::Portage, "install_package" do |