blob: 18e9ca9a0ce69a320fab480450a4c6e8cff85a85 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
require_relative '../../spec_helper'
require 'bigdecimal'
describe "BigDecimal#inspect" do
before :each do
@bigdec = BigDecimal("1234.5678")
end
it "returns String" do
@bigdec.inspect.kind_of?(String).should == true
end
it "looks like this" do
@bigdec.inspect.should == "0.12345678e4"
end
it "properly cases non-finite values" do
BigDecimal("NaN").inspect.should == "NaN"
BigDecimal("Infinity").inspect.should == "Infinity"
BigDecimal("+Infinity").inspect.should == "Infinity"
BigDecimal("-Infinity").inspect.should == "-Infinity"
end
end
|