summaryrefslogtreecommitdiff
path: root/spec/classes/yaml_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/classes/yaml_spec.rb')
-rw-r--r--spec/classes/yaml_spec.rb39
1 files changed, 39 insertions, 0 deletions
diff --git a/spec/classes/yaml_spec.rb b/spec/classes/yaml_spec.rb
new file mode 100644
index 0000000..c5912f2
--- /dev/null
+++ b/spec/classes/yaml_spec.rb
@@ -0,0 +1,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
+