summaryrefslogtreecommitdiff
path: root/spec/classes/yaml_spec.rb
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2016-01-28 00:55:26 +0100
committermh <mh@immerda.ch>2016-01-28 00:55:26 +0100
commit8ca75f6d074b83ee48d9ce713cdb3e28e57d2cf8 (patch)
tree11ea8f3d49648e2a781f6d830babdbe8801fda35 /spec/classes/yaml_spec.rb
parent572fd99995e50591f3e774582937c28eb337aa00 (diff)
update module to make it work with all the new features of trocla 0.2.2
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
+