Files
RubyMotion/test/spec/nsdecimal_spec.rb
2012-09-10 15:36:37 +02:00

12 lines
365 B
Ruby

describe "NSDecimal" do
it "can be created from NSDecimalNumber" do
dn = NSDecimalNumber.decimalNumberWithString('123.456')
d = dn.decimalValue
d.class.should == NSDecimal
NSDecimalNumber.decimalNumberWithDecimal(d).should == dn
ptr = Pointer.new(NSDecimal.type)
ptr[0] = d
NSDecimalString(ptr, nil).should == dn.stringValue
end
end