5 it { is_expected.not_to eq(nil) }
7 it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
8 it { is_expected.to run.with_params(0.1, 0.2).and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
10 describe 'passing a string' do
11 it { is_expected.to run.with_params('0.1').and_return(true) }
12 it { is_expected.to run.with_params('1.0').and_return(true) }
13 it { is_expected.to run.with_params('1').and_return(false) }
14 it { is_expected.to run.with_params('one').and_return(false) }
15 it { is_expected.to run.with_params('one 1.0').and_return(false) }
16 it { is_expected.to run.with_params('1.0 one').and_return(false) }
19 describe 'passing numbers' do
20 it { is_expected.to run.with_params(0.1).and_return(true) }
21 it { is_expected.to run.with_params(1.0).and_return(true) }
22 it { is_expected.to run.with_params(1).and_return(false) }
25 context 'Checking for deprecation warning' do
27 ENV.delete('STDLIB_LOG_DEPRECATIONS')
29 # Checking for deprecation warning, which should only be provoked when the env variable for it is set.
30 it 'should display a single deprecation' do
31 ENV['STDLIB_LOG_DEPRECATIONS'] = "true"
32 scope.expects(:warning).with(includes('This method is deprecated'))
33 is_expected.to run.with_params(2.2).and_return(true)
35 it 'should display no warning for deprecation' do
36 ENV['STDLIB_LOG_DEPRECATIONS'] = "false"
37 scope.expects(:warning).with(includes('This method is deprecated')).never
38 is_expected.to run.with_params(1.0).and_return(true)