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
|
require File.expand_path(File.join(File.dirname(__FILE__),'../spec_helper'))
describe 'trocla::yaml', :type => 'class' do
let(:facts){
{
:domain => 'example.com',
}
}
context 'with default params' do
it { should contain_class('trocla::config').with(
'store' => 'moneta',
'store_options' => {
'adapter' => 'YAML',
'adapter_options' => {
'file' => '/var/lib/trocla/trocla_data.yaml',
}
}
)}
it { should contain_file('/etc/puppet/troclarc.yaml').with_content("---
profiles:
sysdomain_nc:
name_constraints:
- example.com
store: :moneta
store_options:
adapter: :YAML
adapter_options:
:file: /var/lib/trocla/trocla_data.yaml
") }
it { should contain_file('/var/lib/trocla').with(
:ensure => 'directory',
:owner => 'puppet',
:group => 0,
:mode => '0600',
:require => 'Package[trocla]'
)}
it { should contain_file('/var/lib/trocla/trocla_data.yaml').with(
:ensure => 'file',
:owner => 'puppet',
:group => 0,
:mode => '0600',
:require => 'Package[trocla]'
)}
it { should compile.with_all_deps }
end
end
|