diff options
author | Eric Putnam <putnam.eric@gmail.com> | 2017-07-18 15:16:34 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-18 15:16:34 -0700 |
commit | 27003b7b2de5021c512b094050de9063f0f3a134 (patch) | |
tree | 0da0fc6f1116f665569aa63724e72f5c65b2d725 /spec/functions | |
parent | 596878a7bc1fd4a64da89c5c760accb3e8178ec1 (diff) | |
parent | 39ea2c0bc49d812f41dcbbed6635e25607f80970 (diff) |
Merge pull request #748 from npwalker/add_round_function
Add a round function to complement ceiling and floor
Diffstat (limited to 'spec/functions')
-rwxr-xr-x | spec/functions/round_spec.rb | 11 |
1 files changed, 11 insertions, 0 deletions
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 |