Sha256: 2441fa66de82e7bf371f917a2d4c5e3616c269806f0d9e2e2a46955638648d40

Contents?: true

Size: 1.02 KB

Versions: 28

Compression:

Stored size: 1.02 KB

Contents

require 'spec_helper'

# Note that much of the functionality of the dnf provider is already tested with yum provider tests,
# as yum is the parent provider.

provider_class = Puppet::Type.type(:package).provider(:dnf)

context 'default' do
  (19..21).each do |ver|
    it "should not be the default provider on fedora#{ver}" do
      Facter.stubs(:value).with(:osfamily).returns(:redhat)
      Facter.stubs(:value).with(:operatingsystem).returns(:fedora)
      Facter.stubs(:value).with(:operatingsystemmajrelease).returns("#{ver}")
      expect(provider_class).to_not be_default
    end
  end

  (22..26).each do |ver|
    it "should be the default provider on fedora#{ver}" do
      Facter.stubs(:value).with(:osfamily).returns(:redhat)
      Facter.stubs(:value).with(:operatingsystem).returns(:fedora)
      Facter.stubs(:value).with(:operatingsystemmajrelease).returns("#{ver}")
      expect(provider_class).to be_default
    end
  end
end

describe provider_class do
  it_behaves_like 'RHEL package provider', provider_class, 'dnf'
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
puppet-5.5.7 spec/unit/provider/package/dnf_spec.rb
puppet-5.5.7-x86-mingw32 spec/unit/provider/package/dnf_spec.rb
puppet-5.5.7-x64-mingw32 spec/unit/provider/package/dnf_spec.rb
puppet-5.5.7-universal-darwin spec/unit/provider/package/dnf_spec.rb
puppet-5.5.6 spec/unit/provider/package/dnf_spec.rb
puppet-5.5.6-x86-mingw32 spec/unit/provider/package/dnf_spec.rb
puppet-5.5.6-x64-mingw32 spec/unit/provider/package/dnf_spec.rb
puppet-5.5.6-universal-darwin spec/unit/provider/package/dnf_spec.rb
puppet-5.5.3 spec/unit/provider/package/dnf_spec.rb
puppet-5.5.3-x86-mingw32 spec/unit/provider/package/dnf_spec.rb
puppet-5.5.3-x64-mingw32 spec/unit/provider/package/dnf_spec.rb
puppet-5.5.3-universal-darwin spec/unit/provider/package/dnf_spec.rb
puppet-5.5.2 spec/unit/provider/package/dnf_spec.rb
puppet-5.5.2-x86-mingw32 spec/unit/provider/package/dnf_spec.rb
puppet-5.5.2-x64-mingw32 spec/unit/provider/package/dnf_spec.rb
puppet-5.5.2-universal-darwin spec/unit/provider/package/dnf_spec.rb
puppet-5.5.1 spec/unit/provider/package/dnf_spec.rb
puppet-5.5.1-x86-mingw32 spec/unit/provider/package/dnf_spec.rb
puppet-5.5.1-x64-mingw32 spec/unit/provider/package/dnf_spec.rb
puppet-5.5.1-universal-darwin spec/unit/provider/package/dnf_spec.rb