Sha256: 50909ff978243c764cbe24caa82c11150866d1574e7f751a0f9e50fdabddf789

Contents?: true

Size: 1.48 KB

Versions: 35

Compression:

Stored size: 1.48 KB

Contents

#!/usr/bin/env rspec
require '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

Version data entries

35 entries across 35 versions & 3 rubygems

Version Path
puppet-2.7.26 spec/unit/provider/package/hpux_spec.rb
puppet-2.7.25 spec/unit/provider/package/hpux_spec.rb
puppet-2.7.24 spec/unit/provider/package/hpux_spec.rb
puppet-2.7.23 spec/unit/provider/package/hpux_spec.rb
puppet-2.7.22 spec/unit/provider/package/hpux_spec.rb
puppet-2.7.21 spec/unit/provider/package/hpux_spec.rb
puppet-2.7.20 spec/unit/provider/package/hpux_spec.rb
puppet-2.7.20.rc1 spec/unit/provider/package/hpux_spec.rb
librarian-puppet-0.9.4 vendor/gems/ruby/1.8/gems/puppet-2.7.18/spec/unit/provider/package/hpux_spec.rb
puppet-2.7.19 spec/unit/provider/package/hpux_spec.rb
supply_drop-0.11.0 examples/vendored-puppet/vendor/puppet-2.7.8/spec/unit/provider/package/hpux_spec.rb
librarian-puppet-0.9.3 vendor/gems/ruby/1.8/gems/puppet-2.7.18/spec/unit/provider/package/hpux_spec.rb
supply_drop-0.10.2 examples/vendored-puppet/vendor/puppet-2.7.8/spec/unit/provider/package/hpux_spec.rb
puppet-2.7.18 spec/unit/provider/package/hpux_spec.rb
supply_drop-0.10.1 examples/vendored-puppet/vendor/puppet-2.7.8/spec/unit/provider/package/hpux_spec.rb
supply_drop-0.10.0 examples/vendored-puppet/vendor/puppet-2.7.8/spec/unit/provider/package/hpux_spec.rb
puppet-2.7.17 spec/unit/provider/package/hpux_spec.rb
puppet-2.7.16 spec/unit/provider/package/hpux_spec.rb
puppet-2.7.14 spec/unit/provider/package/hpux_spec.rb
puppet-2.7.13 spec/unit/provider/package/hpux_spec.rb