diff options
author | Dominic Cleal <dcleal@redhat.com> | 2011-03-18 23:18:41 +0000 |
---|---|---|
committer | Dominic Cleal <dcleal@redhat.com> | 2011-03-18 23:20:01 +0000 |
commit | ab5bc35eac89001f1c8c8358f4489efda8315e9c (patch) | |
tree | 4180934fef4235a225e5d50f47a1926f8b9ed6f6 | |
parent | e5827098b11fd8f9922a3e9f80c8c573d302a4d4 (diff) | |
download | puppet-ab5bc35eac89001f1c8c8358f4489efda8315e9c.tar.gz puppet-ab5bc35eac89001f1c8c8358f4489efda8315e9c.tar.xz puppet-ab5bc35eac89001f1c8c8358f4489efda8315e9c.zip |
(#4258) Update pkgutil spec for recent impl changes
Fix test output of pkgutil for commands using --single
Fix expected upgrade command to match impl
-rwxr-xr-x | spec/unit/provider/package/pkgutil_spec.rb | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/spec/unit/provider/package/pkgutil_spec.rb b/spec/unit/provider/package/pkgutil_spec.rb index 10cebfed1..01142b4e0 100755 --- a/spec/unit/provider/package/pkgutil_spec.rb +++ b/spec/unit/provider/package/pkgutil_spec.rb @@ -37,7 +37,7 @@ describe provider do describe "when updating" do it "should use a command without versioned package" do - @provider.expects(:pkguti).with('-y', '-i', 'TESTpkg') + @provider.expects(:pkguti).with('-y', '-u', 'TESTpkg') @provider.update end end @@ -52,24 +52,22 @@ describe provider do describe "when getting latest version" do it "should return TESTpkg's version string" do fake_data = " -CSWsvn 1.4.5,REV=2007.11.18 SAME -TESTpkg 1.4.5,REV=2007.11.18 1.4.5,REV=2007.11.20 -CSWemacs notinst 22.1" +noisy output here +TESTpkg 1.4.5,REV=2007.11.18 1.4.5,REV=2007.11.20" provider.expects(:pkguti).with(['-c', '--single', 'TESTpkg']).returns fake_data @provider.latest.should == "1.4.5,REV=2007.11.20" end it "should handle TESTpkg's 'SAME' version string" do fake_data = " -CSWsvn 1.4.5,REV=2007.11.18 SAME -TESTpkg 1.4.5,REV=2007.11.18 SAME -CSWemacs notinst 22.1" +noisy output here +TESTpkg 1.4.5,REV=2007.11.18 SAME" provider.expects(:pkguti).with(['-c', '--single', 'TESTpkg']).returns fake_data @provider.latest.should == "1.4.5,REV=2007.11.18" end it "should handle a non-existent package" do - fake_data = "CSWsvn 1.4.5,REV=2007.11.18 SAME" + fake_data = "noisy output here" provider.expects(:pkguti).with(['-c', '--single', 'TESTpkg']).returns fake_data @provider.latest.should == nil end @@ -90,10 +88,8 @@ gpg: Signature made February 17, 2011 05:27:53 PM GMT using DSA key ID E12E9D2F gpg: Good signature from \"Distribution Manager <dm@blastwave.org>\" ==> 2770 packages loaded from /var/opt/csw/pkgutil/catalog.mirror.opencsw.org_opencsw_unstable_i386_5.11 package installed catalog -TESTpkg 1.4.5,REV=2007.11.18 1.4.5,REV=2007.11.20 -testingnoise -testing noise again" - provider.expects(:pkguti).returns fake_data +TESTpkg 1.4.5,REV=2007.11.18 1.4.5,REV=2007.11.20" + provider.expects(:pkguti).with(['-c', '--single', 'TESTpkg']).returns fake_data @provider.latest.should == "1.4.5,REV=2007.11.20" end end @@ -112,7 +108,7 @@ testing noise again" end it "should handle a non-existent package" do - fake_data = "CSWsvn 1.4.5,REV=2007.11.18 SAME" + fake_data = "noisy output here" provider.expects(:pkguti).with(['-c', '--single', 'TESTpkg']).returns fake_data @provider.query[:ensure].should == :absent end |