Skip to content

Commit 530d2ef

Browse files
author
Emerson Prado
committed
Add spec test for present + installed convergence
1 parent 76d0ec4 commit 530d2ef

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

spec/functions/ensure_packages_spec.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,16 @@
4141
it { expect(lambda { catalogue }).to contain_package('foo').with({'provider' => 'rpm', 'ensure' => 'present'}) }
4242
it { expect(lambda { catalogue }).to contain_package('bar').with({'provider' => 'gem', 'ensure' => 'present'}) }
4343
end
44+
45+
context 'given a catalog with "package { puppet: ensure => present }"' do
46+
let(:pre_condition) { 'package { puppet: ensure => present }' }
47+
48+
describe 'after running ensure_package("puppet", { "ensure" => "installed" })' do
49+
before { subject.call(['puppet', { "ensure" => "installed" }]) }
50+
51+
# this lambda is required due to strangeness within rspec-puppet's expectation handling
52+
it { expect(lambda { catalogue }).to contain_package('puppet').with_ensure('present') }
53+
end
54+
end
55+
4456
end

0 commit comments

Comments
 (0)