Sha256: b49d5f7ee17dabcb3d76f45fc2a52f545cdda896b11e3a33ea7637e5ff137b2f

Contents?: true

Size: 1.5 KB

Versions: 340

Compression:

Stored size: 1.5 KB

Contents

require 'spec_helper'

describe Puppet::Type.type(:package).provider(:hpux) do
  before(:each) do
    # Create a mock resource
    @resource = double('resource')

    # A catch all; no parameters set
    allow(@resource).to receive(:[]).and_return(nil)

    # But set name and source
    allow(@resource).to receive(:[]).with(:name).and_return("mypackage")
    allow(@resource).to receive(:[]).with(:source).and_return("mysource")
    allow(@resource).to receive(:[]).with(:ensure).and_return(:installed)

    @provider = subject()
    allow(@provider).to receive(:resource).and_return(@resource)
  end

  it "should have an install method" do
    @provider = subject()
    expect(@provider).to respond_to(:install)
  end

  it "should have an uninstall method" do
    @provider = subject()
    expect(@provider).to respond_to(:uninstall)
  end

  it "should have a swlist method" do
    @provider = subject()
    expect(@provider).to respond_to(:swlist)
  end

  context "when installing" do
    it "should use a command-line like 'swinstall -x mount_all_filesystems=false -s SOURCE PACKAGE-NAME'" do
      expect(@provider).to receive(:swinstall).with('-x', 'mount_all_filesystems=false', '-s', 'mysource', 'mypackage')
      @provider.install
    end
  end

  context "when uninstalling" do
    it "should use a command-line like 'swremove -x mount_all_filesystems=false PACKAGE-NAME'" do
      expect(@provider).to receive(:swremove).with('-x', 'mount_all_filesystems=false', 'mypackage')
      @provider.uninstall
    end
  end
end

Version data entries

340 entries across 340 versions & 1 rubygems

Version Path
puppet-8.3.0 spec/unit/provider/package/hpux_spec.rb
puppet-8.3.0-x86-mingw32 spec/unit/provider/package/hpux_spec.rb
puppet-8.3.0-x64-mingw32 spec/unit/provider/package/hpux_spec.rb
puppet-8.3.0-universal-darwin spec/unit/provider/package/hpux_spec.rb
puppet-8.4.0 spec/unit/provider/package/hpux_spec.rb
puppet-8.4.0-x86-mingw32 spec/unit/provider/package/hpux_spec.rb
puppet-8.4.0-x64-mingw32 spec/unit/provider/package/hpux_spec.rb
puppet-8.4.0-universal-darwin spec/unit/provider/package/hpux_spec.rb
puppet-7.28.0 spec/unit/provider/package/hpux_spec.rb
puppet-7.28.0-x86-mingw32 spec/unit/provider/package/hpux_spec.rb
puppet-7.28.0-x64-mingw32 spec/unit/provider/package/hpux_spec.rb
puppet-7.28.0-universal-darwin spec/unit/provider/package/hpux_spec.rb
puppet-8.3.1 spec/unit/provider/package/hpux_spec.rb
puppet-8.3.1-x86-mingw32 spec/unit/provider/package/hpux_spec.rb
puppet-8.3.1-x64-mingw32 spec/unit/provider/package/hpux_spec.rb
puppet-8.3.1-universal-darwin spec/unit/provider/package/hpux_spec.rb
puppet-7.27.0 spec/unit/provider/package/hpux_spec.rb
puppet-7.27.0-x86-mingw32 spec/unit/provider/package/hpux_spec.rb
puppet-7.27.0-x64-mingw32 spec/unit/provider/package/hpux_spec.rb
puppet-7.27.0-universal-darwin spec/unit/provider/package/hpux_spec.rb