diff options
author | Nan Liu <nan@puppetlabs.com> | 2012-05-01 16:16:10 -0700 |
---|---|---|
committer | Nan Liu <nan@puppetlabs.com> | 2012-05-01 16:16:10 -0700 |
commit | c83ffff9493443845c1545240f75d8136c0ecdff (patch) | |
tree | 2a4f1450709f3559bf2b6cad95c7efe04011161b /spec/defines/tftp_file_spec.rb | |
parent | df6c470fd39e6e4e92968d414ae9021b4ec67205 (diff) | |
download | puppet-tftp-c83ffff9493443845c1545240f75d8136c0ecdff.tar.gz puppet-tftp-c83ffff9493443845c1545240f75d8136c0ecdff.tar.bz2 |
Add support files for initial release.
* Update documentation.
* Fix puppet-lint 80 char issues.
* Add spec tests.
* Add modulefile, changelog, rakefile, and license.
Diffstat (limited to 'spec/defines/tftp_file_spec.rb')
-rw-r--r-- | spec/defines/tftp_file_spec.rb | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/spec/defines/tftp_file_spec.rb b/spec/defines/tftp_file_spec.rb new file mode 100644 index 0000000..00072e6 --- /dev/null +++ b/spec/defines/tftp_file_spec.rb @@ -0,0 +1,49 @@ +require 'spec_helper' + +describe 'tftp::file' do + + let(:title) { 'sample' } + + describe 'when deploying on debian' 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', + 'owner' => 'tftp', + 'group' => 'tftp', + 'mode' => '0644' + }) } + end + + describe 'when deploying on ubuntu' do + let(:facts) { { :operatingsystem => 'ubuntu', + :path => '/usr/local/bin:/usr/bin:/bin', } } + + it { should include_class('tftp') } + it { should contain_file('/var/lib/tftpboot/sample').with({ + 'ensure' => 'file', + 'owner' => 'tftp', + 'group' => 'tftp', + 'mode' => '0644' + }) } + end + + describe 'when deploying with parameters' do + let(:params) { {:ensure => 'directory', + :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' + }) } + end +end |