X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=3rdparty%2Fmodules%2Fstdlib%2Fspec%2Facceptance%2Fvalidate_array_spec.rb;h=a76321dc986881fee86f6585e71f2bf8d5f80afc;hb=6963202b4b62c2816655ac9532521b018fdf83bd;hp=b53e98c273ea54d0c7d684f03734d35e993be3f1;hpb=a69999e580f8b3abd12446c2d6ad59e517651813;p=mirror%2Fdsa-puppet.git diff --git a/3rdparty/modules/stdlib/spec/acceptance/validate_array_spec.rb b/3rdparty/modules/stdlib/spec/acceptance/validate_array_spec.rb index b53e98c27..a76321dc9 100755 --- a/3rdparty/modules/stdlib/spec/acceptance/validate_array_spec.rb +++ b/3rdparty/modules/stdlib/spec/acceptance/validate_array_spec.rb @@ -1,7 +1,7 @@ #! /usr/bin/env ruby -S rspec require 'spec_helper_acceptance' -describe 'validate_array function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do +describe 'validate_array function' do describe 'success' do it 'validates a single argument' do pp = <<-EOS @@ -20,14 +20,14 @@ describe 'validate_array function', :unless => UNSUPPORTED_PLATFORMS.include?(fa apply_manifest(pp, :catch_failures => true) end - it 'validates a non-array' do - { - %{validate_array({'a' => 'hash' })} => "Hash", - %{validate_array('string')} => "String", - %{validate_array(false)} => "FalseClass", - %{validate_array(undef)} => "String" - }.each do |pp,type| - expect(apply_manifest(pp, :expect_failures => true).stderr).to match(/a #{type}/) + [ + %{validate_array({'a' => 'hash' })}, + %{validate_array('string')}, + %{validate_array(false)}, + %{validate_array(undef)} + ].each do |pp| + it "rejects #{pp.inspect}" do + expect(apply_manifest(pp, :expect_failures => true).stderr).to match(/is not an Array\. It looks to be a/) end end end