This commit refactors to ensure 80 character lines.
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
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
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
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