Skip to content

Commit 444393b

Browse files
Dan BodeJeff McCune
authored andcommitted
re-formatting
This commit refactors to ensure 80 character lines.
1 parent 97d327a commit 444393b

File tree

3 files changed

+17
-8
lines changed

3 files changed

+17
-8
lines changed

lib/puppet/parser/functions/ensure_resource.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
raise(ArgumentError, 'Must specify a title') unless title
2727
params ||= {}
2828
if function_defined_with_params(["#{type}[#{title}]", params])
29-
Puppet.debug("Resource #{type}[#{title}] does not need to be created b/c it already exists")
29+
Puppet.debug("Resource #{type}[#{title}] not created b/c it already exists")
3030
else
3131
function_create_resources([type.capitalize, { title => params }])
3232
end

spec/functions/defined_with_params_spec.rb

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,21 @@
1717
end
1818
end
1919

20-
describe 'when comparted against a resource with attributes' do
20+
describe 'when compared against a resource with attributes' do
2121
let :pre_condition do
2222
'user { "dan": ensure => present, shell => "/bin/csh", managehome => false}'
2323
end
2424
it do
2525
should run.with_params('User[dan]', {}).and_return(true)
26-
should run.with_params('User[dan]', {'ensure' => 'present'}).and_return(true)
27-
should run.with_params('User[dan]', {'ensure' => 'present', 'managehome' => false}).and_return(true)
28-
should run.with_params('User[dan]', {'ensure' => 'absent', 'managehome' => false}).and_return(false)
2926
should run.with_params('User[dan]', '').and_return(true)
27+
should run.with_params('User[dan]', {'ensure' => 'present'}
28+
).and_return(true)
29+
should run.with_params('User[dan]',
30+
{'ensure' => 'present', 'managehome' => false}
31+
).and_return(true)
32+
should run.with_params('User[dan]',
33+
{'ensure' => 'absent', 'managehome' => false}
34+
).and_return(false)
3035
end
3136
end
3237
end

spec/functions/ensure_resource_spec.rb

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
end
2020
end
2121

22-
describe 'when comparted against a resource with attributes' do
22+
describe 'when compared against a resource with attributes' do
2323
let :pre_condition do
2424
'user { "dan": ensure => present, shell => "/bin/csh", managehome => false}'
2525
end
@@ -28,9 +28,13 @@
2828
should run.with_params('User', 'dan', {})
2929
should run.with_params('User', 'dan', '')
3030
should run.with_params('User', 'dan', {'ensure' => 'present'})
31-
should run.with_params('User', 'dan', {'ensure' => 'present', 'managehome' => false})
31+
should run.with_params('User', 'dan',
32+
{'ensure' => 'present', 'managehome' => false}
33+
)
3234
# test that this fails
33-
should run.with_params('User', 'dan', {'ensure' => 'absent', 'managehome' => false}).and_raise_error(Puppet::Error)
35+
should run.with_params('User', 'dan',
36+
{'ensure' => 'absent', 'managehome' => false}
37+
).and_raise_error(Puppet::Error)
3438
end
3539
end
3640
end

0 commit comments

Comments
 (0)