[BigDecimal] Add tests for NSDecimalNumber -> NSDecimal.

This commit is contained in:
Eloy Durán
2014-05-14 16:25:37 +02:00
parent 252ff5b7e5
commit 143fbdf869

View File

@@ -166,7 +166,7 @@ describe 'BigDecimal' do
end
end
describe 'concerning Objective-C interoperability' do
describe 'concerning (Objective-)C interoperability' do
it 'can be passed to Objective-C APIs transperantly' do
string = '0.123456789123456789'
formatter = NSNumberFormatter.new
@@ -188,5 +188,16 @@ describe 'BigDecimal' do
value.class.should == BigDecimal
value.inspect.should == string
end
it 'converts BigDecimal to NSDecimal' do
string = '0.123456789123456789'
number = NSDecimalNumber.decimalNumberWithDecimal(BigDecimal.new(string))
number.description.should == string
end
it 'converts BigDecimal to a pointer to NSDecimal' do
string = '0.123456789123456789'
NSDecimalString(BigDecimal.new(string), NSLocale.currentLocale).should == string
end
end
end