From d67f60fc164fce2ec53c0cde7ea9d9dbf665455a Mon Sep 17 00:00:00 2001 From: David Schmitt Date: Tue, 18 May 2010 16:42:16 +0200 Subject: Fix ProviderDpkg specs to avoid any real executions --- spec/unit/provider/package/dpkg.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spec/unit/provider/package/dpkg.rb b/spec/unit/provider/package/dpkg.rb index 7e3e8df43..d0c1d2622 100755 --- a/spec/unit/provider/package/dpkg.rb +++ b/spec/unit/provider/package/dpkg.rb @@ -8,6 +8,7 @@ describe provider do before do @resource = stub 'resource', :[] => "asdf" @provider = provider.new(@resource) + @provider.expects(:execute).never # forbid "manual" executions @fakeresult = "install ok installed asdf 1.0\n" end @@ -131,6 +132,7 @@ describe provider do it "should use 'dpkg -i' to install the package" do @resource.expects(:[]).with(:source).returns "mypackagefile" + @provider.expects(:unhold) @provider.expects(:dpkg).with { |*command| command[-1] == "mypackagefile" and command[-2] == "-i" } @provider.install @@ -138,6 +140,7 @@ describe provider do it "should keep old config files if told to do so" do @resource.expects(:[]).with(:configfiles).returns :keep + @provider.expects(:unhold) @provider.expects(:dpkg).with { |*command| command[0] == "--force-confold" } @provider.install @@ -145,6 +148,7 @@ describe provider do it "should replace old config files if told to do so" do @resource.expects(:[]).with(:configfiles).returns :replace + @provider.expects(:unhold) @provider.expects(:dpkg).with { |*command| command[0] == "--force-confnew" } @provider.install -- cgit