spec/cell_spec.rb in rspreadsheet-0.2.11 vs spec/cell_spec.rb in rspreadsheet-0.2.12
- old
+ new
@@ -92,10 +92,12 @@
@sheet2.cells(1,2).type.should eq :string
@sheet2.cells(2,2).type.should eq :date
@sheet2.cells(3,1).type.should eq :float
@sheet2.cells(3,2).type.should eq :percentage
@sheet2.cells(4,2).type.should eq :string
+ @sheet2.cells('B22').type.should eq :currency
+ @sheet2.cells('B23').type.should eq :currency
@sheet2.cells(200,200).type.should eq :unassigned
end
it 'returns value of correct type' do
@sheet2[1,2].should be_kind_of(String)
@sheet2[2,2].should be_kind_of(Date)
@@ -308,9 +310,19 @@
@cell.formula='=1+5'
@cell.formula.should_not be_nil
@cell.value = 'baf'
@cell.type.should eq :string
@cell.formula.should be_nil
+ end
+ it 'works well with currency types' do
+ @usdcell = @sheet2.cells('B22')
+ @usdcell.type.should eq :currency
+ @usdcell.value.should == -147984.84
+ @usdcell.format.currency.should == 'USD'
+
+ @czkcell = @sheet2.cells('B23')
+ @czkcell.value.should == 344.to_d
+ @czkcell.format.currency.should == 'CZK'
end
end