summaryrefslogtreecommitdiff
path: root/spec/classes/yaml_spec.rb
blob: c5912f2136cb32f2fcee25da66208d9f13f5c016 (plain)
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
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/trocla_data.yaml').with(
      :ensure => 'file',
      :owner  => 'puppet',
      :group  => 0,
      :mode   => '0600'
    )}
    it { should compile.with_all_deps }
  end
end