1 #! /usr/bin/env ruby -S rspec
2 require 'spec_helper_acceptance'
4 describe 'validate_re function' do
6 it 'validates a string' do
10 validate_re($one,$two)
13 apply_manifest(pp, :catch_failures => true)
15 it 'validates an array' do
18 $two = ['^one$', '^two']
19 validate_re($one,$two)
22 apply_manifest(pp, :catch_failures => true)
24 it 'validates a failed array' do
27 $two = ['^two$', '^three']
28 validate_re($one,$two)
31 apply_manifest(pp, :expect_failures => true)
33 it 'validates a failed array with a custom error message' do
37 validate_re($one,$two,"The $puppetversion fact does not match 2.7")
40 expect(apply_manifest(pp, :expect_failures => true).stderr).to match(/does not match/)
44 it 'handles improper number of arguments'
45 it 'handles improper argument types'