]> gitweb.fluxo.info Git - puppet-tftp.git/commitdiff
Add recurse option to tftp::file class.
authorThomas Van Doren <thomas.vandoren@gmail.com>
Tue, 5 Jun 2012 03:45:19 +0000 (20:45 -0700)
committerThomas Van Doren <thomas.vandoren@gmail.com>
Tue, 5 Jun 2012 03:45:19 +0000 (20:45 -0700)
Update rspec tests to assert the value of recurse in various cases.

manifests/file.pp
spec/defines/tftp_file_spec.rb

index 72c9ebd776357d16994d78ea1d980c85a999b4f7..db62c87deaaf32312d0eecfdefedf9121a04ed1a 100644 (file)
@@ -10,6 +10,7 @@
 #
 define tftp::file (
   $ensure  = file,
+  $recurse = false,
   $owner   = 'tftp',
   $group   = 'tftp',
   $mode    = '0644',
@@ -20,6 +21,7 @@ define tftp::file (
 
   file { "${tftp::directory}/${name}":
     ensure  => $ensure,
+    recurse => $recurse,
     owner   => $owner,
     group   => $group,
     mode    => $mode,
index 00072e60da48bbd88a840da7c73b18500c655baf..8caa65ba6d0dd5443235d4fbb2bfbb6b15bb65f7 100644 (file)
@@ -10,10 +10,11 @@ describe 'tftp::file' do
 
     it { should include_class('tftp') }
     it { should contain_file('/srv/tftp/sample').with({
-      'ensure' => 'file',
-      'owner'  => 'tftp',
-      'group'  => 'tftp',
-      'mode'   => '0644'
+      'ensure'  => 'file',
+      'recurse' => false,
+      'owner'   => 'tftp',
+      'group'   => 'tftp',
+      'mode'    => '0644'
     }) }
   end
 
@@ -23,27 +24,30 @@ describe 'tftp::file' do
 
     it { should include_class('tftp') }
     it { should contain_file('/var/lib/tftpboot/sample').with({
-      'ensure' => 'file',
-      'owner'  => 'tftp',
-      'group'  => 'tftp',
-      'mode'   => '0644'
+      'ensure'  => 'file',
+      'recurse' => false,
+      'owner'   => 'tftp',
+      'group'   => 'tftp',
+      'mode'    => '0644'
     }) }
   end
 
   describe 'when deploying with parameters' do
-    let(:params) { {:ensure => 'directory',
-                    :owner  => 'root',
-                    :group  => 'root',
-                    :mode   => '0755' }}
+    let(:params) { {:ensure  => 'directory',
+                    :recurse => true,
+                    :owner   => 'root',
+                    :group   => 'root',
+                    :mode    => '0755' }}
     let(:facts) { { :operatingsystem => 'Debian',
                     :path            => '/usr/local/bin:/usr/bin:/bin', } }
 
     it { should include_class('tftp') }
     it { should contain_file('/srv/tftp/sample').with({
-      'ensure' => 'directory',
-      'owner'  => 'root',
-      'group'  => 'root',
-      'mode'   => '0755'
+      'ensure'  => 'directory',
+      'recurse' => true,
+      'owner'   => 'root',
+      'group'   => 'root',
+      'mode'    => '0755'
     }) }
   end
 end