X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=3rdparty%2Fmodules%2Fstdlib%2Fspec%2Ffunctions%2Fround_spec.rb;fp=3rdparty%2Fmodules%2Fstdlib%2Fspec%2Ffunctions%2Fround_spec.rb;h=8b13478f2525a843a8ecc4ce028ea8433a0abc9b;hb=6963202b4b62c2816655ac9532521b018fdf83bd;hp=0000000000000000000000000000000000000000;hpb=a69999e580f8b3abd12446c2d6ad59e517651813;p=mirror%2Fdsa-puppet.git diff --git a/3rdparty/modules/stdlib/spec/functions/round_spec.rb b/3rdparty/modules/stdlib/spec/functions/round_spec.rb new file mode 100755 index 000000000..8b13478f2 --- /dev/null +++ b/3rdparty/modules/stdlib/spec/functions/round_spec.rb @@ -0,0 +1,14 @@ +require 'spec_helper' + +describe 'round' do + it { is_expected.not_to eq(nil) } + it { is_expected.to run.with_params(34.3).and_return(34) } + it { is_expected.to run.with_params(-34.3).and_return(-34) } + it { is_expected.to run.with_params(34.5).and_return(35) } + it { is_expected.to run.with_params(-34.5).and_return(-35) } + it { is_expected.to run.with_params(34.7).and_return(35) } + it { is_expected.to run.with_params(-34.7).and_return(-35) } + it { is_expected.to run.with_params("test").and_raise_error Puppet::ParseError } + it { is_expected.to run.with_params("test", "best").and_raise_error Puppet::ParseError } + it { is_expected.to run.with_params(3, 4).and_raise_error Puppet::ParseError } +end