diff options
author | Mark Plaksin <happy@usg.edu> | 2008-08-14 16:06:54 -0400 |
---|---|---|
committer | James Turnbull <james@lovedthanlost.net> | 2008-08-20 01:00:32 +1000 |
commit | b6609ee5f4e6bffc467da4f3f9623f22e9e07095 (patch) | |
tree | 8f85b1661d6611d6a0a16c775281a511bc8d3588 /spec | |
parent | 3e482a27191d2f90e2e281ad19f3143034584f0f (diff) | |
download | puppet-b6609ee5f4e6bffc467da4f3f9623f22e9e07095.tar.gz puppet-b6609ee5f4e6bffc467da4f3f9623f22e9e07095.tar.xz puppet-b6609ee5f4e6bffc467da4f3f9623f22e9e07095.zip |
Fixed #1508 - Add HP-UX package provider.
Diffstat (limited to 'spec')
-rw-r--r-- | spec/unit/provider/package/hpux.rb | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/spec/unit/provider/package/hpux.rb b/spec/unit/provider/package/hpux.rb new file mode 100644 index 000000000..32eae5189 --- /dev/null +++ b/spec/unit/provider/package/hpux.rb @@ -0,0 +1,52 @@ +#!/usr/bin/env ruby + +require File.dirname(__FILE__) + '/../../../spec_helper' + +provider_class = Puppet::Type.type(:package).provider(:hpux) + +describe provider_class do + before(:each) do + # Create a mock resource + @resource = stub 'resource' + + # A catch all; no parameters set + @resource.stubs(:[]).returns(nil) + + # But set name and source + @resource.stubs(:[]).with(:name).returns "mypackage" + @resource.stubs(:[]).with(:source).returns "mysource" + @resource.stubs(:[]).with(:ensure).returns :installed + + @provider = provider_class.new + @provider.stubs(:resource).returns @resource + end + + it "should have an install method" do + @provider = provider_class.new + @provider.should respond_to(:install) + end + + it "should have an uninstall method" do + @provider = provider_class.new + @provider.should respond_to(:uninstall) + end + + it "should have a swlist method" do + @provider = provider_class.new + @provider.should respond_to(:swlist) + end + + describe "when installing" do + it "should use a command-line like 'swinstall -x mount_all_filesystems=false -s SOURCE PACKAGE-NAME'" do + @provider.expects(:swinstall).with('-x', 'mount_all_filesystems=false', '-s', 'mysource', 'mypackage') + @provider.install + end + end + + describe "when uninstalling" do + it "should use a command-line like 'swremove -x mount_all_filesystems=false PACKAGE-NAME'" do + @provider.expects(:swremove).with('-x', 'mount_all_filesystems=false', 'mypackage') + @provider.uninstall + end + end + end |