1 #! /usr/bin/env ruby -S rspec
2 require 'spec_helper_acceptance'
4 describe 'member function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
5 shared_examples 'item found' do
6 it 'should output correctly' do
7 apply_manifest(pp, :catch_failures => true) do |r|
8 expect(r.stdout).to match(/Notice: output correct/)
13 it 'members arrays' do
15 $a = ['aaa','bbb','ccc']
20 notify { 'output correct': }
24 apply_manifest(pp, :catch_failures => true) do |r|
25 expect(r.stdout).to match(/Notice: output correct/)
28 describe 'members array of integers' do
29 it_should_behave_like 'item found' do
31 if member( [1,2,3,4], 4 ){
32 notify { 'output correct': }
38 describe 'members of mixed array' do
39 it_should_behave_like 'item found' do
41 if member( ['a','4',3], 'a' ){
42 notify { 'output correct': }
48 it 'members arrays without members'
52 it 'handles improper argument counts'