summaryrefslogtreecommitdiff
path: root/spec/acceptance
diff options
context:
space:
mode:
authorMorgan Haskel <morgan@puppetlabs.com>2014-11-10 11:10:41 -0800
committerMorgan Haskel <morgan@puppetlabs.com>2014-11-10 11:10:41 -0800
commit850297b560738ff385959a97a96c916105be5631 (patch)
tree5ff121d13c8078d6e113a2968157622f83ee798e /spec/acceptance
parent406e9dbda2fe3378ba624b8297e3209c3298e515 (diff)
parent03f0ecd1286196c1d63342fe10f079e588cd2e58 (diff)
downloadpuppet-stdlib-850297b560738ff385959a97a96c916105be5631.tar.gz
puppet-stdlib-850297b560738ff385959a97a96c916105be5631.tar.bz2
Merge pull request #354 from puppetlabs/4.3.x
4.3.x
Diffstat (limited to 'spec/acceptance')
-rwxr-xr-xspec/acceptance/member_spec.rb28
1 files changed, 28 insertions, 0 deletions
diff --git a/spec/acceptance/member_spec.rb b/spec/acceptance/member_spec.rb
index b467dbb..fe75a07 100755
--- a/spec/acceptance/member_spec.rb
+++ b/spec/acceptance/member_spec.rb
@@ -2,6 +2,13 @@
require 'spec_helper_acceptance'
describe 'member function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+ shared_examples 'item found' do
+ it 'should output correctly' do
+ apply_manifest(pp, :catch_failures => true) do |r|
+ expect(r.stdout).to match(/Notice: output correct/)
+ end
+ end
+ end
describe 'success' do
it 'members arrays' do
pp = <<-EOS
@@ -18,8 +25,29 @@ describe 'member function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('oper
expect(r.stdout).to match(/Notice: output correct/)
end
end
+ describe 'members array of integers' do
+ it_should_behave_like 'item found' do
+ let(:pp) { <<-EOS
+ if member( [1,2,3,4], 4 ){
+ notify { 'output correct': }
+ }
+ EOS
+ }
+ end
+ end
+ describe 'members of mixed array' do
+ it_should_behave_like 'item found' do
+ let(:pp) { <<-EOS
+ if member( ['a','4',3], 'a' ){
+ notify { 'output correct': }
+}
+ EOS
+ }
+ end
+ end
it 'members arrays without members'
end
+
describe 'failure' do
it 'handles improper argument counts'
end