We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3eb8587 commit 5415af3Copy full SHA for 5415af3
1 file changed
core/float/shared/to_i.rb
@@ -1,11 +1,14 @@
1
describe :float_to_i, shared: true do
2
it "returns self truncated to an Integer" do
3
- -> { (0.0 / 0.0).send(@method) }.should raise_error(FloatDomainError)
4
899.2.send(@method).should eql(899)
5
-1.122256e-45.send(@method).should eql(0)
6
5_213_451.9201.send(@method).should eql(5213451)
7
1.233450999123389e+12.send(@method).should eql(1233450999123)
8
-9223372036854775808.1.send(@method).should eql(-9223372036854775808)
9
9223372036854775808.1.send(@method).should eql(9223372036854775808)
10
end
+
11
+ it "raises a FloatDomainError for NaN" do
12
+ -> { nan_value.send(@method) }.should raise_error(FloatDomainError)
13
+ end
14
0 commit comments