From 39ea2c0bc49d812f41dcbbed6635e25607f80970 Mon Sep 17 00:00:00 2001 From: Nick Walker Date: Tue, 28 Mar 2017 13:16:26 -0700 Subject: Add a round function to complement ceiling and floor --- spec/functions/round_spec.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 spec/functions/round_spec.rb (limited to 'spec') diff --git a/spec/functions/round_spec.rb b/spec/functions/round_spec.rb new file mode 100755 index 0000000..5aa801c --- /dev/null +++ b/spec/functions/round_spec.rb @@ -0,0 +1,11 @@ +require 'spec_helper' + +describe 'stdlib::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) } +end -- cgit v1.2.3