Skip to content

Commit fddb332

Browse files
committed
Make Integer#round spec work regardless of pointer size
The spec is actually testing a behaviour stemming from NUM2INT(), and since `sizeof(long)>=sizeof(int)`, `min_long-1` always makes NUM2INT() raise `RangeError`.
1 parent 40adc63 commit fddb332

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

spec/ruby/core/integer/round_spec.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,8 @@
2121
(-25 * 10**70).round(-71).should eql(-30 * 10**70)
2222
end
2323

24-
platform_is_not wordsize: 32 do
25-
it "raises a RangeError when passed a big negative value" do
26-
-> { 42.round(fixnum_min) }.should raise_error(RangeError)
27-
end
24+
it "raises a RangeError when passed a big negative value" do
25+
-> { 42.round(min_long - 1) }.should raise_error(RangeError)
2826
end
2927

3028
it "raises a RangeError when passed Float::INFINITY" do

0 commit comments

Comments
 (0)