summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTP Honey <tphoney@users.noreply.github.com>2015-12-17 13:59:52 +0000
committerTP Honey <tphoney@users.noreply.github.com>2015-12-17 13:59:52 +0000
commit8ea26c4c45347d402bc6e280ca021d3f1bbaab4f (patch)
tree5243add245a91f1b3e5db3462c1dece379dcf58e
parentd2ae00cd5fe821d4ab96b3fd1c05c6c2d3d1c27d (diff)
parent02965b89e558d5af98ce589da5f5687c4d613b49 (diff)
downloadpuppet-stdlib-8ea26c4c45347d402bc6e280ca021d3f1bbaab4f.tar.gz
puppet-stdlib-8ea26c4c45347d402bc6e280ca021d3f1bbaab4f.tar.bz2
Merge pull request #559 from DavidS/fm-3802-fix-ensure_resource-test
(FM-3802) make ensure_resource test of packages
-rwxr-xr-xspec/acceptance/ensure_resource_spec.rb20
1 files changed, 14 insertions, 6 deletions
diff --git a/spec/acceptance/ensure_resource_spec.rb b/spec/acceptance/ensure_resource_spec.rb
index fe619a9..93f25dd 100755
--- a/spec/acceptance/ensure_resource_spec.rb
+++ b/spec/acceptance/ensure_resource_spec.rb
@@ -1,18 +1,26 @@
#! /usr/bin/env ruby -S rspec
require 'spec_helper_acceptance'
-describe 'ensure_resource function', :unless => fact('osfamily') =~ /(windows|Suse)/i do
+describe 'ensure_resource function' do
describe 'success' do
- it 'ensure_resource a package' do
- apply_manifest('package { "rake": ensure => absent, provider => "gem", }')
+ it 'ensures a resource already declared' do
+ apply_manifest('')
pp = <<-EOS
- $a = "rake"
- ensure_resource('package', $a, {'provider' => 'gem'})
+ notify { "test": loglevel => 'err' }
+ 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
apply_manifest(pp, :expect_changes => true)
end
- it 'ensures a resource already declared'
it 'takes defaults arguments'
end
describe 'failure' do