Sha256: bcb35f85084356776193c259f988878ac446051f103f9b675684b234b1709b71

Contents?: true

Size: 916 Bytes

Versions: 19

Compression:

Stored size: 916 Bytes

Contents

#!/usr/bin/env ruby

require File.dirname(__FILE__) + '/../../spec_helper'

describe Puppet::Type.type(:package), "when choosing a default package provider" do
  before do
    # the default provider is cached.
    Puppet::Type.type(:package).defaultprovider = nil
  end

  def provider_name(os)
    {"Ubuntu" => :apt, "Debian" => :apt, "Darwin" => :pkgdmg, "RedHat" => :up2date, "Fedora" => :yum, "FreeBSD" => :ports, "OpenBSD" => :openbsd, "Solaris" => :sun}[os]
  end

  it "should have a default provider" do
    Puppet::Type.type(:package).defaultprovider.should_not be_nil
  end

  it "should choose the correct provider each platform" do
    unless default_provider = provider_name(Facter.value(:operatingsystem))
      pending("No default provider specified in this test for #{Facter.value(:operatingsystem)}")
    end
    Puppet::Type.type(:package).defaultprovider.name.should == default_provider
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
puppet-2.6.18 spec/integration/type/package_spec.rb
puppet-2.6.17 spec/integration/type/package_spec.rb
puppet-2.6.16 spec/integration/type/package_spec.rb
puppet-2.6.15 spec/integration/type/package_spec.rb
puppet-2.6.14 spec/integration/type/package_spec.rb
puppet-2.6.13 spec/integration/type/package_spec.rb
puppet-2.6.12 spec/integration/type/package_spec.rb
puppet-2.6.11 spec/integration/type/package_spec.rb
puppet-2.6.10 spec/integration/type/package_spec.rb
puppet-2.6.9 spec/integration/type/package_spec.rb
puppet-2.6.8 spec/integration/type/package_spec.rb
puppet-2.6.7 spec/integration/type/package_spec.rb
puppet-2.6.6 spec/integration/type/package_spec.rb
puppet-2.6.5 spec/integration/type/package_spec.rb
puppet-2.6.4 spec/integration/type/package_spec.rb
puppet-2.6.3 spec/integration/type/package_spec.rb
puppet-2.6.2 spec/integration/type/package_spec.rb
puppet-2.6.1 spec/integration/type/package_spec.rb
puppet-2.6.0 spec/integration/type/package_spec.rb