X-Git-Url: https://git.adam-barratt.org.uk/?p=mirror%2Fdsa-puppet.git;a=blobdiff_plain;f=3rdparty%2Fmodules%2Fstdlib%2Fspec%2Ffunctions%2Fis_float_spec.rb;h=a231446fa0c9af8029439fbfee26fe5d5d58864e;hp=effb1da2eeb3e27643d4f38f9f1e6cff02efa040;hb=30caaa85aed7015ca0d77216bff175eebd917eb7;hpb=6f656bd4265e3dab13b9af2bf96e9044322e9d8f diff --git a/3rdparty/modules/stdlib/spec/functions/is_float_spec.rb b/3rdparty/modules/stdlib/spec/functions/is_float_spec.rb index effb1da2e..a231446fa 100644 --- a/3rdparty/modules/stdlib/spec/functions/is_float_spec.rb +++ b/3rdparty/modules/stdlib/spec/functions/is_float_spec.rb @@ -5,21 +5,17 @@ describe 'is_float' do it { is_expected.to run.with_params.and_raise_error(Puppet::ParseError, %r{wrong number of arguments}i) } it { is_expected.to run.with_params(0.1, 0.2).and_raise_error(Puppet::ParseError, %r{wrong number of arguments}i) } - - describe 'passing a string' do - it { is_expected.to run.with_params('0.1').and_return(true) } - it { is_expected.to run.with_params('1.0').and_return(true) } - it { is_expected.to run.with_params('1').and_return(false) } - it { is_expected.to run.with_params('one').and_return(false) } - it { is_expected.to run.with_params('one 1.0').and_return(false) } - it { is_expected.to run.with_params('1.0 one').and_return(false) } - end - - describe 'passing numbers' do - it { is_expected.to run.with_params(0.1).and_return(true) } - it { is_expected.to run.with_params(1.0).and_return(true) } - it { is_expected.to run.with_params(1).and_return(false) } - end + it { is_expected.to run.with_params('0.1').and_return(true) } + it { is_expected.to run.with_params('1.0').and_return(true) } + it { is_expected.to run.with_params('1').and_return(false) } + it { is_expected.to run.with_params('one').and_return(false) } + it { is_expected.to run.with_params('one 1.0').and_return(false) } + it { is_expected.to run.with_params('1.0 one').and_return(false) } + it { is_expected.to run.with_params(0.1).and_return(true) } + it { is_expected.to run.with_params(1.0).and_return(true) } + it { is_expected.to run.with_params(1).and_return(false) } + it { is_expected.to run.with_params({}).and_return(false) } + it { is_expected.to run.with_params([]).and_return(false) } context 'with deprecation warning' do after(:each) do