1 #! /usr/bin/env ruby -S rspec
2 require 'spec_helper_acceptance'
4 describe 'validate_string function' do
6 it 'validates a single argument' do
12 apply_manifest(pp, :catch_failures => true)
14 it 'validates an multiple arguments' do
18 validate_string($one,$two)
21 apply_manifest(pp, :catch_failures => true)
23 it 'validates undef' do
25 validate_string(undef)
28 apply_manifest(pp, :catch_failures => true)
30 it 'validates a non-string' do
32 %{validate_string({ 'a' => 'hash' })} => "Hash",
33 %{validate_string(['array'])} => "Array",
34 %{validate_string(false)} => "FalseClass",
36 expect(apply_manifest(pp, :expect_failures => true).stderr).to match(/a #{type}/)
41 it 'handles improper number of arguments'