diff options
author | Raphaël Pinson <raphael.pinson@camptocamp.com> | 2013-03-15 20:39:16 +0100 |
---|---|---|
committer | Raphaël Pinson <raphael.pinson@camptocamp.com> | 2013-03-15 20:39:16 +0100 |
commit | a534f53b803ba46dd7ea2b55312949af688f850b (patch) | |
tree | 9b587b540e2ed653318802ef9a6fc623c51cde85 /spec/hosts/simple_redhat_spec.rb | |
parent | b9de77d2043341a6dd60c91daa26b6434c988f5f (diff) |
Add specs for hosts
Diffstat (limited to 'spec/hosts/simple_redhat_spec.rb')
-rw-r--r-- | spec/hosts/simple_redhat_spec.rb | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/spec/hosts/simple_redhat_spec.rb b/spec/hosts/simple_redhat_spec.rb new file mode 100644 index 0000000..5045377 --- /dev/null +++ b/spec/hosts/simple_redhat_spec.rb @@ -0,0 +1,82 @@ +require 'spec_helper' + +describe 'simple_redhat' do + let (:facts) { { + :osfamily => 'RedHat', + } } + + context 'when versions are not specified' do + it { should contain_package('augeas').with( + :ensure => 'present' + ) } + it { should contain_package('augeas-libs').with( + :ensure => 'present' + ) } + it { should contain_package('ruby-augeas').with( + :ensure => 'present', + :name => 'ruby-augeas' + ) } + end + + context 'when versions are specified' do + let (:facts) { { + :osfamily => 'RedHat', + :augeas_version => '1.2.3', + :augeas_ruby_version => '3.2.1', + } } + + it { should contain_package('augeas').with( + :ensure => '1.2.3' + ) } + it { should contain_package('augeas-libs').with( + :ensure => '1.2.3' + ) } + it { should contain_package('ruby-augeas').with( + :ensure => '3.2.1', + :name => 'ruby-augeas' + ) } + end + + context 'with standard lens_dir' do + it { should contain_file('/usr/share/augeas/lenses').with( + :ensure => 'directory', + :purge => 'true', + :force => 'true', + :recurse => 'true', + :recurselimit => 1 + ) } + it { should contain_file('/usr/share/augeas/lenses/dist').with( + :ensure => 'directory', + :purge => 'false' + ) } + it { should contain_file('/usr/share/augeas/lenses/tests').with( + :ensure => 'directory', + :purge => 'true', + :force => 'true' + ).without(:recurse) } + end + + context 'with a non standard lens_dir' do + let (:facts) { { + :osfamily => 'RedHat', + :augeas_lens_dir => '/opt/augeas/lenses' + } } + + it { should contain_file('/opt/augeas/lenses').with( + :ensure => 'directory', + :purge => 'true', + :force => 'true', + :recurse => 'true', + :recurselimit => 1 + ) } + it { should contain_file('/opt/augeas/lenses/dist').with( + :ensure => 'directory', + :purge => 'false' + ) } + it { should contain_file('/opt/augeas/lenses/tests').with( + :ensure => 'directory', + :purge => 'true', + :force => 'true' + ).without(:recurse) } + end +end |