Add puppet/archive module
[mirror/dsa-puppet.git] / 3rdparty / modules / archive / spec / classes / staging_spec.rb
1 require 'spec_helper'
2
3 describe 'archive::staging' do
4   context 'RHEL Puppet opensource' do
5     let(:facts) { { os: { family: 'RedHat' }, puppetversion: '4.4.0' } }
6
7     it { is_expected.to contain_class 'archive' }
8     it do
9       is_expected.to contain_file('/opt/staging').with(
10         owner: '0',
11         group: '0',
12         mode: '0640'
13       )
14     end
15   end
16
17   context 'RHEL Puppet opensource with params' do
18     let(:facts) { { os: { family: 'RedHat' }, puppetversion: '4.4.0' } }
19
20     let(:params) do
21       {
22         path: '/tmp/staging',
23         owner: 'puppet',
24         group: 'puppet',
25         mode: '0755'
26       }
27     end
28
29     it { is_expected.to contain_class 'archive' }
30     it do
31       is_expected.to contain_file('/tmp/staging').with(
32         owner: 'puppet',
33         group: 'puppet',
34         mode: '0755'
35       )
36     end
37   end
38
39   context 'Windows Puppet Enterprise' do
40     let(:facts) do
41       {
42         os: { family: 'Windows' },
43         puppetversion: '3.4.3 (Puppet Enterprise 3.2.3)',
44         archive_windir: 'C:/Windows/Temp/staging'
45       }
46     end
47
48     it { is_expected.to contain_class 'archive' }
49     it do
50       is_expected.to contain_file('C:/Windows/Temp/staging').with(
51         owner: 'S-1-5-32-544',
52         group: 'S-1-5-18',
53         mode: '0640'
54       )
55     end
56   end
57 end