aboutsummaryrefslogtreecommitdiffstats
path: root/spec/ruby/core/integer/round_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/integer/round_spec.rb')
-rw-r--r--spec/ruby/core/integer/round_spec.rb26
1 files changed, 4 insertions, 22 deletions
diff --git a/spec/ruby/core/integer/round_spec.rb b/spec/ruby/core/integer/round_spec.rb
index feb6d475d3..45ac126fd3 100644
--- a/spec/ruby/core/integer/round_spec.rb
+++ b/spec/ruby/core/integer/round_spec.rb
@@ -6,14 +6,6 @@ describe "Integer#round" do
it_behaves_like :integer_to_i, :round
it_behaves_like :integer_rounding_positive_precision, :round
- ruby_version_is ""..."2.5" do # Not just since 2.4
- it "rounds itself as a float if passed a positive precision" do
- [2, -4, 10**70, -10**100].each do |v|
- v.round(42).should eql(v.to_f)
- end
- end
- end
-
# redmine:5228
it "returns itself rounded if passed a negative value" do
+249.round(-2).should eql(+200)
@@ -78,20 +70,10 @@ describe "Integer#round" do
(-25).round(-1, half: nil).should eql(-30)
end
- ruby_version_is "2.4"..."2.5" do
- it "returns itself as a float if passed a positive precision and the half option" do
- 35.round(1, half: :up).should eql(35.0)
- 35.round(1, half: :down).should eql(35.0)
- 35.round(1, half: :even).should eql(35.0)
- end
- end
-
- ruby_version_is "2.5" do
- it "returns itself if passed a positive precision and the half option" do
- 35.round(1, half: :up).should eql(35)
- 35.round(1, half: :down).should eql(35)
- 35.round(1, half: :even).should eql(35)
- end
+ it "returns itself if passed a positive precision and the half option" do
+ 35.round(1, half: :up).should eql(35)
+ 35.round(1, half: :down).should eql(35)
+ 35.round(1, half: :even).should eql(35)
end
it "raises ArgumentError for an unknown rounding mode" do