summaryrefslogtreecommitdiff
path: root/spec/hosts/with_lens_spec.rb
diff options
context:
space:
mode:
authorMicah Anderson <micah@riseup.net>2013-06-14 16:04:51 -0400
committerMicah Anderson <micah@riseup.net>2013-06-14 16:06:58 -0400
commitda0ce6473e4b3d65b60878c8cde62379222ee499 (patch)
tree987c42142c548ab1f3db7df9392bec306bd29f2f /spec/hosts/with_lens_spec.rb
parent4d57632afc0d9be88c4c9a30ee26599bdbefef00 (diff)
parent0c75e1584827e52c3af20d304a76111f37307c48 (diff)
Merge remote-tracking branch 'camptocamp/master'
Conflicts: README manifests/debian.pp manifests/files.pp manifests/init.pp manifests/lens.pp manifests/redhat.pp
Diffstat (limited to 'spec/hosts/with_lens_spec.rb')
-rw-r--r--spec/hosts/with_lens_spec.rb56
1 files changed, 56 insertions, 0 deletions
diff --git a/spec/hosts/with_lens_spec.rb b/spec/hosts/with_lens_spec.rb
new file mode 100644
index 0000000..d7a5249
--- /dev/null
+++ b/spec/hosts/with_lens_spec.rb
@@ -0,0 +1,56 @@
+require 'spec_helper'
+
+describe 'with_lens' do
+ let (:facts) { {
+ :osfamily => 'RedHat',
+ } }
+
+ context 'when lens_source is passed' do
+ let (:facts) { {
+ :osfamily => 'RedHat',
+ :augeas_lens_source => '/tmp/foo.aug',
+ } }
+
+ it { should contain_file('/usr/share/augeas/lenses/foo.aug') }
+ it { should contain_exec('Typecheck lens foo') }
+ it { should_not contain_file('/usr/share/augeas/lenses/tests/test_foo.aug') }
+ it { should_not contain_exec('Test lens foo') }
+ end
+
+ context 'when lens_source and test_source are passed' do
+ let (:facts) { {
+ :osfamily => 'RedHat',
+ :augeas_lens_source => '/tmp/foo.aug',
+ :augeas_test_source => '/tmp/test_foo.aug',
+ } }
+
+ it { should contain_file('/usr/share/augeas/lenses/foo.aug') }
+ it { should contain_exec('Typecheck lens foo') }
+ it { should contain_file('/usr/share/augeas/lenses/tests/test_foo.aug') }
+ it { should contain_exec('Test lens foo') }
+ end
+
+ context 'when stock_since is passed and augeas is older' do
+ let (:facts) { {
+ :osfamily => 'RedHat',
+ :augeas_lens_source => '/tmp/foo.aug',
+ :augeas_stock_since => '1.2.3',
+ :augeasversion => '1.0.0',
+ } }
+
+ it { should contain_file('/usr/share/augeas/lenses/foo.aug') }
+ it { should contain_exec('Typecheck lens foo') }
+ end
+
+ context 'when stock_since is passed and augeas is newer' do
+ let (:facts) { {
+ :osfamily => 'RedHat',
+ :augeas_lens_source => '/tmp/foo.aug',
+ :augeas_stock_since => '1.2.3',
+ :augeasversion => '1.5.0',
+ } }
+
+ it { should_not contain_file('/usr/share/augeas/lenses/foo.aug') }
+ it { should_not contain_exec('Typecheck lens foo') }
+ end
+end