diff options
author | Thomas Van Doren <thomas.vandoren@gmail.com> | 2012-06-04 20:45:19 -0700 |
---|---|---|
committer | Thomas Van Doren <thomas.vandoren@gmail.com> | 2012-06-04 20:45:19 -0700 |
commit | 1343de3817ab64b39ccf4d76ab73f1024f3db0a7 (patch) | |
tree | d3af56dbabf6e01b192710508e68cd9d0d409aa7 | |
parent | 097a1ae83a3f43b639eb3608d3ae83aa33f7b43e (diff) | |
download | puppet-tftp-1343de3817ab64b39ccf4d76ab73f1024f3db0a7.tar.gz puppet-tftp-1343de3817ab64b39ccf4d76ab73f1024f3db0a7.tar.bz2 |
Add recurse option to tftp::file class.
Update rspec tests to assert the value of recurse in various cases.
-rw-r--r-- | manifests/file.pp | 2 | ||||
-rw-r--r-- | spec/defines/tftp_file_spec.rb | 36 |
2 files changed, 22 insertions, 16 deletions
diff --git a/manifests/file.pp b/manifests/file.pp index 72c9ebd..db62c87 100644 --- a/manifests/file.pp +++ b/manifests/file.pp @@ -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, diff --git a/spec/defines/tftp_file_spec.rb b/spec/defines/tftp_file_spec.rb index 00072e6..8caa65b 100644 --- a/spec/defines/tftp_file_spec.rb +++ b/spec/defines/tftp_file_spec.rb @@ -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 |