summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Schmitt <david.schmitt@puppet.com>2016-10-03 15:33:00 +0100
committerGitHub <noreply@github.com>2016-10-03 15:33:00 +0100
commit7228160175a17fb3d7f5b464553ef6c7791cf140 (patch)
tree4b5c00e27043d10a0cd9ad3722266462c6b6bc85
parent96af506f244f37626dc314907817665bfa6b4320 (diff)
parent8a8ebc4850abe4996056a2700a6a50ac7666a922 (diff)
Merge pull request #659 from HelenCampbell/omglob
Ensure validate functions use Puppet 4 deprecation
-rw-r--r--lib/puppet/functions/validate_absolute_path.rb3
-rw-r--r--lib/puppet/functions/validate_array.rb3
-rw-r--r--lib/puppet/functions/validate_bool.rb3
-rw-r--r--lib/puppet/functions/validate_hash.rb3
-rw-r--r--lib/puppet/functions/validate_integer.rb3
-rw-r--r--lib/puppet/functions/validate_ip_address.rb3
-rw-r--r--lib/puppet/functions/validate_ipv4_address.rb3
-rw-r--r--lib/puppet/functions/validate_ipv6_address.rb3
-rw-r--r--lib/puppet/functions/validate_numeric.rb3
-rw-r--r--lib/puppet/functions/validate_re.rb3
-rw-r--r--lib/puppet/functions/validate_string.rb3
-rw-r--r--lib/puppet_x/puppetlabs/stdlib/deprecation_gen.rb19
-rwxr-xr-xspec/acceptance/validate_array_spec.rb16
-rwxr-xr-xspec/acceptance/validate_bool_spec.rb16
-rwxr-xr-xspec/acceptance/validate_hash_spec.rb16
-rw-r--r--spec/functions/deprecation_spec.rb2
-rwxr-xr-xspec/functions/is_array_spec.rb2
-rwxr-xr-xspec/functions/is_bool_spec.rb2
-rwxr-xr-xspec/functions/is_float_spec.rb2
-rwxr-xr-xspec/functions/is_integer_spec.rb2
-rwxr-xr-xspec/functions/is_ip_address_spec.rb2
-rw-r--r--spec/functions/is_ipv4_address_spec.rb2
-rw-r--r--spec/functions/is_ipv6_address_spec.rb2
-rwxr-xr-xspec/functions/is_numeric_spec.rb2
-rwxr-xr-xspec/functions/is_string_spec.rb2
-rwxr-xr-xspec/functions/validate_absolute_path_spec.rb2
-rwxr-xr-xspec/functions/validate_array_spec.rb2
-rwxr-xr-xspec/functions/validate_bool_spec.rb2
-rwxr-xr-xspec/functions/validate_hash_spec.rb2
-rwxr-xr-xspec/functions/validate_integer_spec.rb2
-rw-r--r--spec/functions/validate_ip_address_spec.rb2
-rwxr-xr-xspec/functions/validate_ipv4_address_spec.rb2
-rwxr-xr-xspec/functions/validate_ipv6_address_spec.rb2
-rwxr-xr-xspec/functions/validate_numeric_spec.rb2
-rwxr-xr-xspec/functions/validate_re_spec.rb2
-rwxr-xr-xspec/functions/validate_slength_spec.rb2
-rwxr-xr-xspec/functions/validate_string_spec.rb2
37 files changed, 98 insertions, 46 deletions
diff --git a/lib/puppet/functions/validate_absolute_path.rb b/lib/puppet/functions/validate_absolute_path.rb
new file mode 100644
index 0000000..5ae9d29
--- /dev/null
+++ b/lib/puppet/functions/validate_absolute_path.rb
@@ -0,0 +1,3 @@
+require 'puppet_x/puppetlabs/stdlib/deprecation_gen'
+PuppetX::Puppetlabs::Stdlib.deprecation_gen("validate_absolute_path", "Stdlib::Compat::Absolute_Path")
+# Puppet::Functions.create_function
diff --git a/lib/puppet/functions/validate_array.rb b/lib/puppet/functions/validate_array.rb
new file mode 100644
index 0000000..9155784
--- /dev/null
+++ b/lib/puppet/functions/validate_array.rb
@@ -0,0 +1,3 @@
+require 'puppet_x/puppetlabs/stdlib/deprecation_gen'
+PuppetX::Puppetlabs::Stdlib.deprecation_gen("validate_array", "Stdlib::Compat::Array")
+# Puppet::Functions.create_function
diff --git a/lib/puppet/functions/validate_bool.rb b/lib/puppet/functions/validate_bool.rb
new file mode 100644
index 0000000..10f6edf
--- /dev/null
+++ b/lib/puppet/functions/validate_bool.rb
@@ -0,0 +1,3 @@
+require 'puppet_x/puppetlabs/stdlib/deprecation_gen'
+PuppetX::Puppetlabs::Stdlib.deprecation_gen("validate_bool", "Stdlib::Compat::Bool")
+# Puppet::Functions.create_function
diff --git a/lib/puppet/functions/validate_hash.rb b/lib/puppet/functions/validate_hash.rb
new file mode 100644
index 0000000..5349664
--- /dev/null
+++ b/lib/puppet/functions/validate_hash.rb
@@ -0,0 +1,3 @@
+require 'puppet_x/puppetlabs/stdlib/deprecation_gen'
+PuppetX::Puppetlabs::Stdlib.deprecation_gen("validate_hash", "Stdlib::Compat::Hash")
+# Puppet::Functions.create_function
diff --git a/lib/puppet/functions/validate_integer.rb b/lib/puppet/functions/validate_integer.rb
new file mode 100644
index 0000000..2c4645d
--- /dev/null
+++ b/lib/puppet/functions/validate_integer.rb
@@ -0,0 +1,3 @@
+require 'puppet_x/puppetlabs/stdlib/deprecation_gen'
+PuppetX::Puppetlabs::Stdlib.deprecation_gen("validate_integer", "Stdlib::Compat::Integer")
+# Puppet::Functions.create_function
diff --git a/lib/puppet/functions/validate_ip_address.rb b/lib/puppet/functions/validate_ip_address.rb
new file mode 100644
index 0000000..15a710e
--- /dev/null
+++ b/lib/puppet/functions/validate_ip_address.rb
@@ -0,0 +1,3 @@
+require 'puppet_x/puppetlabs/stdlib/deprecation_gen'
+PuppetX::Puppetlabs::Stdlib.deprecation_gen("validate_ip_address", "Stdlib::Compat::Ip_Address")
+# Puppet::Functions.create_function
diff --git a/lib/puppet/functions/validate_ipv4_address.rb b/lib/puppet/functions/validate_ipv4_address.rb
new file mode 100644
index 0000000..8e1bc59
--- /dev/null
+++ b/lib/puppet/functions/validate_ipv4_address.rb
@@ -0,0 +1,3 @@
+require 'puppet_x/puppetlabs/stdlib/deprecation_gen'
+PuppetX::Puppetlabs::Stdlib.deprecation_gen("validate_ipv4_address", "Stdlib::Compat::Ipv4_Address")
+# Puppet::Functions.create_function
diff --git a/lib/puppet/functions/validate_ipv6_address.rb b/lib/puppet/functions/validate_ipv6_address.rb
new file mode 100644
index 0000000..865648a
--- /dev/null
+++ b/lib/puppet/functions/validate_ipv6_address.rb
@@ -0,0 +1,3 @@
+require 'puppet_x/puppetlabs/stdlib/deprecation_gen'
+PuppetX::Puppetlabs::Stdlib.deprecation_gen("validate_ipv6_address", "Stdlib::Compat::Ipv6_address")
+# Puppet::Functions.create_function
diff --git a/lib/puppet/functions/validate_numeric.rb b/lib/puppet/functions/validate_numeric.rb
new file mode 100644
index 0000000..0c2e1f2
--- /dev/null
+++ b/lib/puppet/functions/validate_numeric.rb
@@ -0,0 +1,3 @@
+require 'puppet_x/puppetlabs/stdlib/deprecation_gen'
+PuppetX::Puppetlabs::Stdlib.deprecation_gen("validate_numeric", "Stdlib::Compat::Numeric")
+# Puppet::Functions.create_function
diff --git a/lib/puppet/functions/validate_re.rb b/lib/puppet/functions/validate_re.rb
new file mode 100644
index 0000000..d63ed42
--- /dev/null
+++ b/lib/puppet/functions/validate_re.rb
@@ -0,0 +1,3 @@
+require 'puppet_x/puppetlabs/stdlib/deprecation_gen'
+PuppetX::Puppetlabs::Stdlib.deprecation_gen("validate_re", "Stdlib::Compat::Re")
+# Puppet::Functions.create_function
diff --git a/lib/puppet/functions/validate_string.rb b/lib/puppet/functions/validate_string.rb
new file mode 100644
index 0000000..a196f43
--- /dev/null
+++ b/lib/puppet/functions/validate_string.rb
@@ -0,0 +1,3 @@
+require 'puppet_x/puppetlabs/stdlib/deprecation_gen'
+PuppetX::Puppetlabs::Stdlib.deprecation_gen("validate_string", "Stdlib::Compat::String")
+# Puppet::Functions.create_function
diff --git a/lib/puppet_x/puppetlabs/stdlib/deprecation_gen.rb b/lib/puppet_x/puppetlabs/stdlib/deprecation_gen.rb
new file mode 100644
index 0000000..0d8908d
--- /dev/null
+++ b/lib/puppet_x/puppetlabs/stdlib/deprecation_gen.rb
@@ -0,0 +1,19 @@
+# Creates a Puppet 4 function for the corresponding puppet 3 validate function, who's name will be passed as an argument, alongside the type for deprecation output purposes.
+module PuppetX
+ module Puppetlabs
+ module Stdlib
+ def self.deprecation_gen(funct, type)
+ Puppet::Functions.create_function(funct, Puppet::Functions::InternalFunction) do
+ dispatch :deprecation_gen do
+ scope_param
+ optional_repeated_param 'Any', :args
+ end
+ define_method 'deprecation_gen' do |scope, *args|
+ call_function('deprecation', 'puppet_3_type_check', "This method is deprecated, please use the stdlib validate_legacy function, with #{type}. There is further documentation for validate_legacy function in the README.")
+ scope.send("function_#{funct}", args)
+ end
+ end
+ end
+ end
+ end
+end
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
diff --git a/spec/functions/deprecation_spec.rb b/spec/functions/deprecation_spec.rb
index 4321c3d..9859833 100644
--- a/spec/functions/deprecation_spec.rb
+++ b/spec/functions/deprecation_spec.rb
@@ -42,7 +42,7 @@ if Puppet.version.to_f >= 4.0
end
else
describe 'deprecation' do
- after(:context) do
+ after(:all) do
ENV.delete('STDLIB_LOG_DEPRECATIONS')
end
ENV['STDLIB_LOG_DEPRECATIONS'] = "true"
diff --git a/spec/functions/is_array_spec.rb b/spec/functions/is_array_spec.rb
index 2350b7f..e89f54b 100755
--- a/spec/functions/is_array_spec.rb
+++ b/spec/functions/is_array_spec.rb
@@ -18,7 +18,7 @@ describe 'is_array' do
it { is_expected.to run.with_params(1).and_return(false) }
it { is_expected.to run.with_params({}).and_return(false) }
context 'Checking for deprecation warning' do
- after(:context) do
+ after(:all) do
ENV.delete('STDLIB_LOG_DEPRECATIONS')
end
# Checking for deprecation warning, which should only be provoked when the env variable for it is set.
diff --git a/spec/functions/is_bool_spec.rb b/spec/functions/is_bool_spec.rb
index 7b2173e..d21345c 100755
--- a/spec/functions/is_bool_spec.rb
+++ b/spec/functions/is_bool_spec.rb
@@ -14,7 +14,7 @@ describe 'is_bool' do
it { is_expected.to run.with_params('true').and_return(false) }
it { is_expected.to run.with_params('false').and_return(false) }
context 'Checking for deprecation warning' do
- after(:context) do
+ after(:all) do
ENV.delete('STDLIB_LOG_DEPRECATIONS')
end
# Checking for deprecation warning, which should only be provoked when the env variable for it is set.
diff --git a/spec/functions/is_float_spec.rb b/spec/functions/is_float_spec.rb
index 44bdc48..af3322e 100755
--- a/spec/functions/is_float_spec.rb
+++ b/spec/functions/is_float_spec.rb
@@ -23,7 +23,7 @@ describe 'is_float' do
end
context 'Checking for deprecation warning' do
- after(:context) do
+ after(:all) do
ENV.delete('STDLIB_LOG_DEPRECATIONS')
end
# Checking for deprecation warning, which should only be provoked when the env variable for it is set.
diff --git a/spec/functions/is_integer_spec.rb b/spec/functions/is_integer_spec.rb
index 4b5dd21..b296830 100755
--- a/spec/functions/is_integer_spec.rb
+++ b/spec/functions/is_integer_spec.rb
@@ -26,7 +26,7 @@ describe 'is_integer' do
it { is_expected.to run.with_params('0001234').and_return(false) }
context 'Checking for deprecation warning' do
- after(:context) do
+ after(:all) do
ENV.delete('STDLIB_LOG_DEPRECATIONS')
end
# Checking for deprecation warning, which should only be provoked when the env variable for it is set.
diff --git a/spec/functions/is_ip_address_spec.rb b/spec/functions/is_ip_address_spec.rb
index fc8af60..39525d7 100755
--- a/spec/functions/is_ip_address_spec.rb
+++ b/spec/functions/is_ip_address_spec.rb
@@ -33,7 +33,7 @@ describe 'is_ip_address' do
scope.expects(:warning).with(includes('This method is deprecated')).never
is_expected.to run.with_params('1.2.3.4').and_return(true)
end
- after(:context) do
+ after(:all) do
ENV.delete('STDLIB_LOG_DEPRECATIONS')
end
end
diff --git a/spec/functions/is_ipv4_address_spec.rb b/spec/functions/is_ipv4_address_spec.rb
index 9d53a9d..e39d93b 100644
--- a/spec/functions/is_ipv4_address_spec.rb
+++ b/spec/functions/is_ipv4_address_spec.rb
@@ -12,7 +12,7 @@ describe 'is_ipv4_address' do
it { is_expected.to run.with_params('one').and_return(false) }
context 'Checking for deprecation warning', if: Puppet.version.to_f < 4.0 do
- after(:context) do
+ after(:all) do
ENV.delete('STDLIB_LOG_DEPRECATIONS')
end
# Checking for deprecation warning, which should only be provoked when the env variable for it is set.
diff --git a/spec/functions/is_ipv6_address_spec.rb b/spec/functions/is_ipv6_address_spec.rb
index 4449fea..acd6a87 100644
--- a/spec/functions/is_ipv6_address_spec.rb
+++ b/spec/functions/is_ipv6_address_spec.rb
@@ -12,7 +12,7 @@ describe 'is_ipv6_address' do
it { is_expected.to run.with_params('one').and_return(false) }
context 'Checking for deprecation warning', if: Puppet.version.to_f < 4.0 do
- after(:context) do
+ after(:all) do
ENV.delete('STDLIB_LOG_DEPRECATIONS')
end
# Checking for deprecation warning, which should only be provoked when the env variable for it is set.
diff --git a/spec/functions/is_numeric_spec.rb b/spec/functions/is_numeric_spec.rb
index ccfb9d8..5962d8a 100755
--- a/spec/functions/is_numeric_spec.rb
+++ b/spec/functions/is_numeric_spec.rb
@@ -29,7 +29,7 @@ describe 'is_numeric' do
it { is_expected.to run.with_params(' - 1234').and_return(false) }
context 'Checking for deprecation warning' do
- after(:context) do
+ after(:all) do
ENV.delete('STDLIB_LOG_DEPRECATIONS')
end
# Checking for deprecation warning, which should only be provoked when the env variable for it is set.
diff --git a/spec/functions/is_string_spec.rb b/spec/functions/is_string_spec.rb
index 460d6e0..e92f85c 100755
--- a/spec/functions/is_string_spec.rb
+++ b/spec/functions/is_string_spec.rb
@@ -28,7 +28,7 @@ describe 'is_string' do
it { is_expected.to run.with_params('0001234').and_return(true) }
context 'Checking for deprecation warning' do
- after(:context) do
+ after(:all) do
ENV.delete('STDLIB_LOG_DEPRECATIONS')
end
# Checking for deprecation warning, which should only be provoked when the env variable for it is set.
diff --git a/spec/functions/validate_absolute_path_spec.rb b/spec/functions/validate_absolute_path_spec.rb
index bdb55f0..9397da5 100755
--- a/spec/functions/validate_absolute_path_spec.rb
+++ b/spec/functions/validate_absolute_path_spec.rb
@@ -1,7 +1,7 @@
require 'spec_helper'
describe 'validate_absolute_path' do
- after(:context) do
+ after(:all) do
ENV.delete('STDLIB_LOG_DEPRECATIONS')
end
diff --git a/spec/functions/validate_array_spec.rb b/spec/functions/validate_array_spec.rb
index f395d16..409b3dc 100755
--- a/spec/functions/validate_array_spec.rb
+++ b/spec/functions/validate_array_spec.rb
@@ -3,7 +3,7 @@ require 'spec_helper'
describe 'validate_array' do
describe 'signature validation' do
- after(:context) do
+ after(:all) do
ENV.delete('STDLIB_LOG_DEPRECATIONS')
end
it { is_expected.not_to eq(nil) }
diff --git a/spec/functions/validate_bool_spec.rb b/spec/functions/validate_bool_spec.rb
index 8b7e438..3074d88 100755
--- a/spec/functions/validate_bool_spec.rb
+++ b/spec/functions/validate_bool_spec.rb
@@ -1,7 +1,7 @@
require 'spec_helper'
describe 'validate_bool' do
- after(:context) do
+ after(:all) do
ENV.delete('STDLIB_LOG_DEPRECATIONS')
end
diff --git a/spec/functions/validate_hash_spec.rb b/spec/functions/validate_hash_spec.rb
index 7b118e2..7533abe 100755
--- a/spec/functions/validate_hash_spec.rb
+++ b/spec/functions/validate_hash_spec.rb
@@ -6,7 +6,7 @@ describe 'validate_hash' do
it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
describe 'check for deprecation warning' do
- after(:context) do
+ after(:all) do
ENV.delete('STDLIB_LOG_DEPRECATIONS')
end
# Checking for deprecation warning
diff --git a/spec/functions/validate_integer_spec.rb b/spec/functions/validate_integer_spec.rb
index ffc59f8..6558d00 100755
--- a/spec/functions/validate_integer_spec.rb
+++ b/spec/functions/validate_integer_spec.rb
@@ -1,7 +1,7 @@
require 'spec_helper'
describe 'validate_integer' do
- after(:context) do
+ after(:all) do
ENV.delete('STDLIB_LOG_DEPRECATIONS')
end
diff --git a/spec/functions/validate_ip_address_spec.rb b/spec/functions/validate_ip_address_spec.rb
index 7040a8d..0414f5e 100644
--- a/spec/functions/validate_ip_address_spec.rb
+++ b/spec/functions/validate_ip_address_spec.rb
@@ -22,7 +22,7 @@ describe 'validate_ip_address' do
it { is_expected.to run.with_params('fe80::a00:27ff:fe94:44d6/64') }
context 'Checking for deprecation warning', if: Puppet.version.to_f < 4.0 do
- after(:context) do
+ after(:all) do
ENV.delete('STDLIB_LOG_DEPRECATIONS')
end
# Checking for deprecation warning, which should only be provoked when the env variable for it is set.
diff --git a/spec/functions/validate_ipv4_address_spec.rb b/spec/functions/validate_ipv4_address_spec.rb
index b60dc8e..d221793 100755
--- a/spec/functions/validate_ipv4_address_spec.rb
+++ b/spec/functions/validate_ipv4_address_spec.rb
@@ -8,7 +8,7 @@ describe 'validate_ipv4_address' do
end
context 'Checking for deprecation warning', if: Puppet.version.to_f < 4.0 do
- after(:context) do
+ after(:all) do
ENV.delete('STDLIB_LOG_DEPRECATIONS')
end
# Checking for deprecation warning, which should only be provoked when the env variable for it is set.
diff --git a/spec/functions/validate_ipv6_address_spec.rb b/spec/functions/validate_ipv6_address_spec.rb
index 87b535e..78810d4 100755
--- a/spec/functions/validate_ipv6_address_spec.rb
+++ b/spec/functions/validate_ipv6_address_spec.rb
@@ -8,7 +8,7 @@ describe 'validate_ipv6_address' do
end
context 'Checking for deprecation warning', if: Puppet.version.to_f < 4.0 do
- after(:context) do
+ after(:all) do
ENV.delete('STDLIB_LOG_DEPRECATIONS')
end
# Checking for deprecation warning, which should only be provoked when the env variable for it is set.
diff --git a/spec/functions/validate_numeric_spec.rb b/spec/functions/validate_numeric_spec.rb
index 4a65649..4c0e24d 100755
--- a/spec/functions/validate_numeric_spec.rb
+++ b/spec/functions/validate_numeric_spec.rb
@@ -1,7 +1,7 @@
require 'spec_helper'
describe 'validate_numeric' do
- after(:context) do
+ after(:all) do
ENV.delete('STDLIB_LOG_DEPRECATIONS')
end
diff --git a/spec/functions/validate_re_spec.rb b/spec/functions/validate_re_spec.rb
index 2fa9ddd..3531182 100755
--- a/spec/functions/validate_re_spec.rb
+++ b/spec/functions/validate_re_spec.rb
@@ -1,7 +1,7 @@
require 'spec_helper'
describe 'validate_re' do
- after(:context) do
+ after(:all) do
ENV.delete('STDLIB_LOG_DEPRECATIONS')
end
diff --git a/spec/functions/validate_slength_spec.rb b/spec/functions/validate_slength_spec.rb
index 2ea253c..e4162de 100755
--- a/spec/functions/validate_slength_spec.rb
+++ b/spec/functions/validate_slength_spec.rb
@@ -1,7 +1,7 @@
require 'spec_helper'
describe 'validate_slength' do
- after(:context) do
+ after(:all) do
ENV.delete('STDLIB_LOG_DEPRECATIONS')
end
diff --git a/spec/functions/validate_string_spec.rb b/spec/functions/validate_string_spec.rb
index 45d6ffc..b5ce763 100755
--- a/spec/functions/validate_string_spec.rb
+++ b/spec/functions/validate_string_spec.rb
@@ -1,7 +1,7 @@
require 'spec_helper'
describe 'validate_string' do
- after(:context) do
+ after(:all) do
ENV.delete('STDLIB_LOG_DEPRECATIONS')
end