aboutsummaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorThomas Van Doren <thomas.vandoren@gmail.com>2012-06-15 19:34:53 -0700
committerThomas Van Doren <thomas.vandoren@gmail.com>2012-06-15 19:34:53 -0700
commit2c22a9b5fd0336681a4fca9d8f875b15950fdacb (patch)
tree3cef80a84c52b9ea624f6f8e0eb52ab10272ee49 /spec
parenta9bd24d91ec70d7f45874afed64069b5f4aabcd3 (diff)
downloadpuppet-tftp-2c22a9b5fd0336681a4fca9d8f875b15950fdacb.tar.gz
puppet-tftp-2c22a9b5fd0336681a4fca9d8f875b15950fdacb.tar.bz2
Add spec tests for recurse params.
One test verifies the defaults for recurse, purge, replace, recurselimit when they are not provided. The other test ensure that setting them in the tftp:file definition correlates to the params getting set on the file.
Diffstat (limited to 'spec')
-rw-r--r--spec/defines/tftp_file_spec.rb37
1 files changed, 37 insertions, 0 deletions
diff --git a/spec/defines/tftp_file_spec.rb b/spec/defines/tftp_file_spec.rb
index 8caa65b..6a032c0 100644
--- a/spec/defines/tftp_file_spec.rb
+++ b/spec/defines/tftp_file_spec.rb
@@ -50,4 +50,41 @@ describe 'tftp::file' do
'mode' => '0755'
}) }
end
+
+ describe 'when deploying without recurse parameters' do
+ 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' => 'file',
+ 'recurse' => false,
+ 'purge' => nil,
+ 'replace' => nil,
+ 'recurselimit' => nil
+ }) }
+ end
+
+ describe 'when deploying with recurse parameters' do
+ let(:params) { {:ensure => 'directory',
+ :recurse => true,
+ :mode => '0755',
+ :recurselimit => 42,
+ :purge => true,
+ :replace => false }}
+ 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',
+ 'recurse' => true,
+ 'owner' => 'tftp',
+ 'group' => 'tftp',
+ 'mode' => '0755',
+ 'recurselimit' => 42,
+ 'purge' => true,
+ 'replace' => false,
+ }) }
+ end
end