File: staging_spec.rb

package info (click to toggle)
puppet-module-voxpupuli-archive 7.1.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 744 kB
  • sloc: ruby: 2,483; sh: 10; makefile: 4
file content (62 lines) | stat: -rw-r--r-- 1,352 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# frozen_string_literal: true

require 'spec_helper'

describe 'archive::staging' do
  context 'RHEL Puppet opensource' do
    let(:facts) { { os: { family: 'RedHat' }, puppetversion: '4.4.0' } }

    it { is_expected.to contain_class 'archive' }

    it do
      expect(subject).to contain_file('/opt/staging').with(
        owner: '0',
        group: '0',
        mode: '0640'
      )
    end
  end

  context 'RHEL Puppet opensource with params' do
    let(:facts) { { os: { family: 'RedHat' }, puppetversion: '4.4.0' } }

    let(:params) do
      {
        path: '/tmp/staging',
        owner: 'puppet',
        group: 'puppet',
        mode: '0755'
      }
    end

    it { is_expected.to contain_class 'archive' }

    it do
      expect(subject).to contain_file('/tmp/staging').with(
        owner: 'puppet',
        group: 'puppet',
        mode: '0755'
      )
    end
  end

  context 'Windows Puppet Enterprise' do
    let(:facts) do
      {
        os: { family: 'Windows' },
        puppetversion: '3.4.3 (Puppet Enterprise 3.2.3)',
        archive_windir: 'C:/Windows/Temp/staging'
      }
    end

    it { is_expected.to contain_class 'archive' }

    it do
      expect(subject).to contain_file('C:/Windows/Temp/staging').with(
        owner: 'S-1-5-32-544',
        group: 'S-1-5-18',
        mode: '0640'
      )
    end
  end
end