summaryrefslogtreecommitdiff
path: root/spec/functions
diff options
context:
space:
mode:
Diffstat (limited to 'spec/functions')
-rw-r--r--spec/functions/defined_with_params_spec.rb13
-rw-r--r--spec/functions/ensure_resource_spec.rb10
2 files changed, 16 insertions, 7 deletions
diff --git a/spec/functions/defined_with_params_spec.rb b/spec/functions/defined_with_params_spec.rb
index f995b67..28dbab3 100644
--- a/spec/functions/defined_with_params_spec.rb
+++ b/spec/functions/defined_with_params_spec.rb
@@ -17,16 +17,21 @@ describe 'defined_with_params' do
end
end
- describe 'when comparted against a resource with attributes' do
+ describe 'when compared against a resource with attributes' do
let :pre_condition do
'user { "dan": ensure => present, shell => "/bin/csh", managehome => false}'
end
it do
should run.with_params('User[dan]', {}).and_return(true)
- should run.with_params('User[dan]', {'ensure' => 'present'}).and_return(true)
- should run.with_params('User[dan]', {'ensure' => 'present', 'managehome' => false}).and_return(true)
- should run.with_params('User[dan]', {'ensure' => 'absent', 'managehome' => false}).and_return(false)
should run.with_params('User[dan]', '').and_return(true)
+ should run.with_params('User[dan]', {'ensure' => 'present'}
+ ).and_return(true)
+ should run.with_params('User[dan]',
+ {'ensure' => 'present', 'managehome' => false}
+ ).and_return(true)
+ should run.with_params('User[dan]',
+ {'ensure' => 'absent', 'managehome' => false}
+ ).and_return(false)
end
end
end
diff --git a/spec/functions/ensure_resource_spec.rb b/spec/functions/ensure_resource_spec.rb
index e03efda..611666e 100644
--- a/spec/functions/ensure_resource_spec.rb
+++ b/spec/functions/ensure_resource_spec.rb
@@ -19,7 +19,7 @@ describe 'ensure_resource' do
end
end
- describe 'when comparted against a resource with attributes' do
+ describe 'when compared against a resource with attributes' do
let :pre_condition do
'user { "dan": ensure => present, shell => "/bin/csh", managehome => false}'
end
@@ -28,9 +28,13 @@ describe 'ensure_resource' do
should run.with_params('User', 'dan', {})
should run.with_params('User', 'dan', '')
should run.with_params('User', 'dan', {'ensure' => 'present'})
- should run.with_params('User', 'dan', {'ensure' => 'present', 'managehome' => false})
+ should run.with_params('User', 'dan',
+ {'ensure' => 'present', 'managehome' => false}
+ )
# test that this fails
- should run.with_params('User', 'dan', {'ensure' => 'absent', 'managehome' => false}).and_raise_error(Puppet::Error)
+ should run.with_params('User', 'dan',
+ {'ensure' => 'absent', 'managehome' => false}
+ ).and_raise_error(Puppet::Error)
end
end
end