diff options
author | Hunter Haugen <hunter@puppet.com> | 2017-04-28 13:47:47 -0700 |
---|---|---|
committer | Helen Campbell <helen@puppetlabs.com> | 2017-05-09 13:16:20 +0100 |
commit | 51fd72ca4accb2760a364d65dfe6f9b672f68d83 (patch) | |
tree | 65b67776a89d9dd640c6fada8266a233bfe7e95d /spec/functions | |
parent | 5ad49ebaecbdbc6faa58282c45aad1c46d4d7f2c (diff) |
add tests
Diffstat (limited to 'spec/functions')
-rwxr-xr-x | spec/functions/ensure_packages_spec.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/functions/ensure_packages_spec.rb b/spec/functions/ensure_packages_spec.rb index 6f94d72..1f89785 100755 --- a/spec/functions/ensure_packages_spec.rb +++ b/spec/functions/ensure_packages_spec.rb @@ -34,6 +34,14 @@ describe 'ensure_packages' do end end + context 'given an empty packages array' do + let(:pre_condition) { 'notify { "hi": } -> Package <| |>; $somearray = ["vim",""]; ensure_packages($somearray)' } + + describe 'after running ensure_package(["vim", ""])' do + it { expect { catalogue }.to raise_error(Puppet::ParseError, /Empty String provided/) } + end + end + context 'given hash of packages' do before { subject.call([{"foo" => { "provider" => "rpm" }, "bar" => { "provider" => "gem" }}, { "ensure" => "present"}]) } before { subject.call([{"パッケージ" => { "ensure" => "absent"}}]) } |