Skip to content

Commit 51fd72c

Browse files
hunnerHelen Campbell
authored and
Helen Campbell
committed
add tests
1 parent 5ad49eb commit 51fd72c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

spec/functions/ensure_packages_spec.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@
3434
end
3535
end
3636

37+
context 'given an empty packages array' do
38+
let(:pre_condition) { 'notify { "hi": } -> Package <| |>; $somearray = ["vim",""]; ensure_packages($somearray)' }
39+
40+
describe 'after running ensure_package(["vim", ""])' do
41+
it { expect { catalogue }.to raise_error(Puppet::ParseError, /Empty String provided/) }
42+
end
43+
end
44+
3745
context 'given hash of packages' do
3846
before { subject.call([{"foo" => { "provider" => "rpm" }, "bar" => { "provider" => "gem" }}, { "ensure" => "present"}]) }
3947
before { subject.call([{"パッケージ" => { "ensure" => "absent"}}]) }

0 commit comments

Comments
 (0)