[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, experimental, updated. debian/2.6.8-1-844-g7ec39d5

Matt Robinson matt at puppetlabs.com
Tue May 10 08:07:08 UTC 2011

The following commit has been merged in the experimental branch:
commit 61803976a835a039784cb199fe1e3957fd9cb64a
Author: Matt Robinson <matt at puppetlabs.com>
Date:   Tue Mar 22 16:40:51 2011 -0700

    (#6527) Fix pip tests
    The testing of lazypip forgot to stub which, so they worked when pip was
    installed, but didn't work when it wasn't.  Appropriate stubbing has
    been put in place, and stubs changed to expects for some stronger
    assertions about what's happening.
    Reviewed-by: Jesse Wolfe <jesse at puppetlabs.com>

diff --git a/spec/unit/provider/package/pip_spec.rb b/spec/unit/provider/package/pip_spec.rb
index 6809d3f..8953b4b 100644
--- a/spec/unit/provider/package/pip_spec.rb
+++ b/spec/unit/provider/package/pip_spec.rb
@@ -161,14 +161,15 @@ describe provider_class do
     it "should retry if pip has not yet been found" do
-      @provider.stubs(:pip).raises(NoMethodError).returns("/fake/bin/pip")
+      @provider.expects(:pip).twice.with('freeze').raises(NoMethodError).then.returns(nil)
+      @provider.expects(:which).with('pip').returns("/fake/bin/pip")
       @provider.method(:lazy_pip).call "freeze"
     it "should fail if pip is missing" do
-      @provider.stubs(:pip).twice.raises(NoMethodError)
-      expect { @provider.method(:lazy_pip).call("freeze") }.to \
-        raise_error(NoMethodError)
+      @provider.expects(:pip).with('freeze').raises(NoMethodError)
+      @provider.expects(:which).with('pip').returns(nil)
+      expect { @provider.method(:lazy_pip).call("freeze") }.to raise_error(NoMethodError)

Puppet packaging for Debian

More information about the Pkg-puppet-devel mailing list