summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/puppet/parser/functions/ensure_resource.rb2
-rw-r--r--spec/functions/defined_with_params_spec.rb13
-rw-r--r--spec/functions/ensure_resource_spec.rb10
3 files changed, 17 insertions, 8 deletions
diff --git a/lib/puppet/parser/functions/ensure_resource.rb b/lib/puppet/parser/functions/ensure_resource.rb
index 3205b9b..6a9e2ed 100644
--- a/lib/puppet/parser/functions/ensure_resource.rb
+++ b/lib/puppet/parser/functions/ensure_resource.rb
@@ -26,7 +26,7 @@ ENDOFDOC
raise(ArgumentError, 'Must specify a title') unless title
params ||= {}
if function_defined_with_params(["#{type}[#{title}]", params])
- Puppet.debug("Resource #{type}[#{title}] does not need to be created b/c it already exists")
+ Puppet.debug("Resource #{type}[#{title}] not created b/c it already exists")
else
function_create_resources([type.capitalize, { title => params }])
end
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