]> gitweb.fluxo.info Git - puppet-stdlib.git/commitdiff
re-formatting
authorDan Bode <dan@puppetlabs.com>
Tue, 14 Aug 2012 01:53:47 +0000 (18:53 -0700)
committerJeff McCune <jeff@puppetlabs.com>
Thu, 25 Oct 2012 17:54:33 +0000 (10:54 -0700)
This commit refactors to ensure 80 character lines.

lib/puppet/parser/functions/ensure_resource.rb
spec/functions/defined_with_params_spec.rb
spec/functions/ensure_resource_spec.rb

index 3205b9b1db188203c2a389af9d71ed2073e53eac..6a9e2ed3df2a9a34739d66a56706e911061895e0 100644 (file)
@@ -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
index f995b6793ede46d1986ace61c31fca5d7c1e5d19..28dbab31192e88ec09c0bb190e1f5d27319fa140 100644 (file)
@@ -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
index e03efdabe373192726d13a602ebffd852c625eaa..611666ee84e997c204905996f8a280099f3f6df9 100644 (file)
@@ -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