Sha256: 5b5915285a119cb2affb896db739a7cc4a5172847838e62aa322288319e2bd37

Contents?: true

Size: 1.52 KB

Versions: 92

Compression:

Stored size: 1.52 KB

Contents

#! /usr/bin/env ruby
require 'spec_helper'

describe "Package provider" do
  include PuppetSpec::Files

  Puppet::Type.type(:package).providers.each do |name|
    provider = Puppet::Type.type(:package).provider(name)

    describe name, :if => provider.suitable? do
      it "should fail when asked to install an invalid package" do
        pending("This test hangs forever with recent versions of RubyGems") if provider.name == :gem

        options = {:name => "nosuch#{provider.name}", :provider => provider.name}
        # The MSI provider requires that source be specified as it is
        # what actually determines if the package exists.
        if provider.name == :msi
          options[:source] = tmpfile("msi_package")
        end

        pkg = Puppet::Type.newpackage(options)
        lambda { pkg.provider.install }.should raise_error
      end

      it "should be able to get a list of existing packages" do
        if provider.name == :msi
          Puppet[:vardir] = tmpdir('msi_package_var_dir')
        end

        # the instances method requires root priviledges on gentoo
        # if the eix cache is outdated (to run eix-update) so make
        # sure we dont actually run eix-update
        if provider.name == :portage
          provider.stubs(:update_eix).returns('Database contains 15240 packages in 155 categories')
        end

        provider.instances.each do |package|
          package.should be_instance_of(provider)
          package.properties[:provider].should == provider.name
        end
      end
    end
  end
end

Version data entries

92 entries across 92 versions & 2 rubygems

Version Path
puppet-3.6.2-x86-mingw32 spec/integration/provider/package_spec.rb
puppet-3.6.1 spec/integration/provider/package_spec.rb
puppet-3.6.1-x86-mingw32 spec/integration/provider/package_spec.rb
puppet-3.6.0 spec/integration/provider/package_spec.rb
puppet-3.6.0-x86-mingw32 spec/integration/provider/package_spec.rb
puppet-3.6.0.rc1 spec/integration/provider/package_spec.rb
puppet-3.6.0.rc1-x86-mingw32 spec/integration/provider/package_spec.rb
puppet-3.5.1 spec/integration/provider/package_spec.rb
puppet-3.5.1-x86-mingw32 spec/integration/provider/package_spec.rb
puppet-3.5.1.rc1 spec/integration/provider/package_spec.rb
puppet-3.5.1.rc1-x86-mingw32 spec/integration/provider/package_spec.rb
puppet-3.5.0.rc3 spec/integration/provider/package_spec.rb
puppet-3.5.0.rc3-x86-mingw32 spec/integration/provider/package_spec.rb
puppet-3.5.0.rc2 spec/integration/provider/package_spec.rb
puppet-3.5.0.rc2-x86-mingw32 spec/integration/provider/package_spec.rb
puppet-3.5.0.rc1 spec/integration/provider/package_spec.rb
puppet-3.5.0.rc1-x86-mingw32 spec/integration/provider/package_spec.rb
puppet-3.4.3 spec/integration/provider/package_spec.rb
puppet-3.4.2 spec/integration/provider/package_spec.rb
puppet-3.4.1 spec/integration/provider/package_spec.rb