Merge pull request #559 from DavidS/fm-3802-fix-ensure_resource-test
(FM-3802) make ensure_resource test of packages
This commit is contained in:
commit
8ea26c4c45
1 changed files with 14 additions and 6 deletions
|
@ -1,18 +1,26 @@
|
||||||
#! /usr/bin/env ruby -S rspec
|
#! /usr/bin/env ruby -S rspec
|
||||||
require 'spec_helper_acceptance'
|
require 'spec_helper_acceptance'
|
||||||
|
|
||||||
describe 'ensure_resource function', :unless => fact('osfamily') =~ /(windows|Suse)/i do
|
describe 'ensure_resource function' do
|
||||||
describe 'success' do
|
describe 'success' do
|
||||||
it 'ensure_resource a package' do
|
it 'ensures a resource already declared' do
|
||||||
apply_manifest('package { "rake": ensure => absent, provider => "gem", }')
|
apply_manifest('')
|
||||||
pp = <<-EOS
|
pp = <<-EOS
|
||||||
$a = "rake"
|
notify { "test": loglevel => 'err' }
|
||||||
ensure_resource('package', $a, {'provider' => 'gem'})
|
ensure_resource('notify', 'test', { 'loglevel' => 'err' })
|
||||||
|
EOS
|
||||||
|
|
||||||
|
apply_manifest(pp, :expect_changes => true)
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'ensures a undeclared resource' do
|
||||||
|
apply_manifest('')
|
||||||
|
pp = <<-EOS
|
||||||
|
ensure_resource('notify', 'test', { 'loglevel' => 'err' })
|
||||||
EOS
|
EOS
|
||||||
|
|
||||||
apply_manifest(pp, :expect_changes => true)
|
apply_manifest(pp, :expect_changes => true)
|
||||||
end
|
end
|
||||||
it 'ensures a resource already declared'
|
|
||||||
it 'takes defaults arguments'
|
it 'takes defaults arguments'
|
||||||
end
|
end
|
||||||
describe 'failure' do
|
describe 'failure' do
|
||||||
|
|
Loading…
Reference in a new issue