comparison modules/stdlib/spec/functions/is_array_spec.rb @ 275:d9352a684e62

Mass update of modules to remove deprecation warnings
author IBBoard <dev@ibboard.co.uk>
date Sun, 26 Jan 2020 11:36:07 +0000
parents c42fb28cff86
children
comparison
equal deleted inserted replaced
274:b2571c28fc27 275:d9352a684e62
21 ENV.delete('STDLIB_LOG_DEPRECATIONS') 21 ENV.delete('STDLIB_LOG_DEPRECATIONS')
22 end 22 end
23 # Checking for deprecation warning, which should only be provoked when the env variable for it is set. 23 # Checking for deprecation warning, which should only be provoked when the env variable for it is set.
24 it 'displays a single deprecation' do 24 it 'displays a single deprecation' do
25 ENV['STDLIB_LOG_DEPRECATIONS'] = 'true' 25 ENV['STDLIB_LOG_DEPRECATIONS'] = 'true'
26 scope.expects(:warning).with(includes('This method is deprecated')) 26 expect(scope).to receive(:warning).with(include('This method is deprecated'))
27 is_expected.to run.with_params(['1.2.3.4']).and_return(true) 27 is_expected.to run.with_params(['1.2.3.4']).and_return(true)
28 end 28 end
29 it 'displays no warning for deprecation' do 29 it 'displays no warning for deprecation' do
30 ENV['STDLIB_LOG_DEPRECATIONS'] = 'false' 30 ENV['STDLIB_LOG_DEPRECATIONS'] = 'false'
31 scope.expects(:warning).with(includes('This method is deprecated')).never 31 expect(scope).to receive(:warning).with(include('This method is deprecated')).never
32 is_expected.to run.with_params(['1.2.3.4']).and_return(true) 32 is_expected.to run.with_params(['1.2.3.4']).and_return(true)
33 end 33 end
34 end 34 end
35 end 35 end