File: up2date_spec.rb

package info (click to toggle)
puppet 5.5.10-4
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 21,116 kB
  • sloc: ruby: 250,669; sh: 1,620; xml: 218; makefile: 151; sql: 103
file content (24 lines) | stat: -rw-r--r-- 672 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# spec/unit/provider/package/up2date_spec.rb
require 'spec_helper'

describe 'up2date package provider' do

  # This sets the class itself as the subject rather than
  # an instance of the class.
  subject do
    Puppet::Type.type(:package).provider(:up2date)
  end

  osfamilies = [ 'redhat' ]
  releases = [ '2.1', '3', '4' ]

  osfamilies.each do |osfamily|
    releases.each do |release|
      it "should be the default provider on #{osfamily} #{release}" do
        Facter.expects(:value).with(:osfamily).returns(osfamily)
        Facter.expects(:value).with(:lsbdistrelease).returns(release)
        expect(subject.default?).to be_truthy
      end
    end
  end
end