From f19aea5a75998da95617fadce7a50aee65022d3b Mon Sep 17 00:00:00 2001 From: Travis Fields Date: Wed, 29 Oct 2014 22:02:13 -0700 Subject: MODULES-1413 Ability to for future parser to use member with FixNum types --- spec/acceptance/member_spec.rb | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'spec') 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 -- cgit v1.2.3