1 #! /usr/bin/env ruby -S rspec
2 require 'spec_helper_acceptance'
4 describe 'validate_bool function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
6 it 'validates a single argument' do
12 apply_manifest(pp, :catch_failures => true)
14 it 'validates an multiple arguments' do
18 validate_bool($one,$two)
21 apply_manifest(pp, :catch_failures => true)
23 it 'validates a non-bool' do
25 %{validate_bool('true')} => "String",
26 %{validate_bool('false')} => "String",
27 %{validate_bool([true])} => "Array",
28 %{validate_bool(undef)} => "String",
30 expect(apply_manifest(pp, :expect_failures => true).stderr).to match(/a #{type}/)
35 it 'handles improper number of arguments'