summaryrefslogtreecommitdiff
path: root/spec/functions/ensure_packages_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/functions/ensure_packages_spec.rb')
-rwxr-xr-xspec/functions/ensure_packages_spec.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/functions/ensure_packages_spec.rb b/spec/functions/ensure_packages_spec.rb
index c824732..5d97684 100755
--- a/spec/functions/ensure_packages_spec.rb
+++ b/spec/functions/ensure_packages_spec.rb
@@ -33,4 +33,12 @@ describe 'ensure_packages' do
it { expect(lambda { catalogue }).to contain_package('facter').with_ensure('present').with_provider("gem") }
end
end
+
+ context 'given hash of packages' do
+ before { subject.call([{"foo" => { "provider" => "rpm" }, "bar" => { "provider" => "gem" }}, { "ensure" => "present"}]) }
+
+ # this lambda is required due to strangeness within rspec-puppet's expectation handling
+ it { expect(lambda { catalogue }).to contain_package('foo').with({'provider' => 'rpm', 'ensure' => 'present'}) }
+ it { expect(lambda { catalogue }).to contain_package('bar').with({'provider' => 'gem', 'ensure' => 'present'}) }
+ end
end