diff options
author | David Schmitt <david.schmitt@puppet.com> | 2016-09-21 12:13:34 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-21 12:13:34 +0100 |
commit | e94beb5bd189296ac3dade603c1b45ac7183ec21 (patch) | |
tree | 48aae9abafbbe893ad8919ed87826151709d6910 /spec | |
parent | 66830ac66ac4d435c56c5f3fc93592c32c087726 (diff) | |
parent | 0ec7ffa5c086c8a1c6e871b086299dd1953fa8ba (diff) |
Merge pull request #654 from HelenCampbell/puppet4Dep
Ensure validate functions use Puppet 4 deprecation
Diffstat (limited to 'spec')
-rwxr-xr-x | spec/acceptance/validate_array_spec.rb | 16 | ||||
-rwxr-xr-x | spec/acceptance/validate_bool_spec.rb | 16 | ||||
-rwxr-xr-x | spec/acceptance/validate_hash_spec.rb | 16 |
3 files changed, 24 insertions, 24 deletions
diff --git a/spec/acceptance/validate_array_spec.rb b/spec/acceptance/validate_array_spec.rb index b53e98c..2f549d5 100755 --- a/spec/acceptance/validate_array_spec.rb +++ b/spec/acceptance/validate_array_spec.rb @@ -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 diff --git a/spec/acceptance/validate_bool_spec.rb b/spec/acceptance/validate_bool_spec.rb index c837f08..5c52d0f 100755 --- a/spec/acceptance/validate_bool_spec.rb +++ b/spec/acceptance/validate_bool_spec.rb @@ -20,14 +20,14 @@ describe 'validate_bool function', :unless => UNSUPPORTED_PLATFORMS.include?(fac apply_manifest(pp, :catch_failures => true) end - it 'validates a non-bool' do - { - %{validate_bool('true')} => "String", - %{validate_bool('false')} => "String", - %{validate_bool([true])} => "Array", - %{validate_bool(undef)} => "String", - }.each do |pp,type| - expect(apply_manifest(pp, :expect_failures => true).stderr).to match(/a #{type}/) + [ + %{validate_bool('true')}, + %{validate_bool('false')}, + %{validate_bool([true])}, + %{validate_bool(undef)} + ].each do |pp| + it "rejects #{pp.inspect}" do + expect(apply_manifest(pp, :expect_failures => true).stderr).to match(/is not a boolean\. It looks to be a/) end end end diff --git a/spec/acceptance/validate_hash_spec.rb b/spec/acceptance/validate_hash_spec.rb index 52fb615..637df0a 100755 --- a/spec/acceptance/validate_hash_spec.rb +++ b/spec/acceptance/validate_hash_spec.rb @@ -20,14 +20,14 @@ describe 'validate_hash function', :unless => UNSUPPORTED_PLATFORMS.include?(fac apply_manifest(pp, :catch_failures => true) end - it 'validates a non-hash' do - { - %{validate_hash('{ "not" => "hash" }')} => "String", - %{validate_hash('string')} => "String", - %{validate_hash(["array"])} => "Array", - %{validate_hash(undef)} => "String", - }.each do |pp,type| - expect(apply_manifest(pp, :expect_failures => true).stderr).to match(/a #{type}/) + [ + %{validate_hash('{ "not" => "hash" }')}, + %{validate_hash('string')}, + %{validate_hash(["array"])}, + %{validate_hash(undef)} + ].each do |pp| + it "rejects #{pp.inspect}" do + expect(apply_manifest(pp, :expect_failures => true).stderr).to match(//) end end end |