spec/rspreadsheet_spec.rb in rspreadsheet-0.1.1 vs spec/rspreadsheet_spec.rb in rspreadsheet-0.2.0

- old
+ new

@@ -1,16 +1,7 @@ require 'spec_helper' -describe Rspreadsheet::Tools do - it 'converts correctly cell adresses' do - Rspreadsheet::Tools.convert_cell_address('A1')[0].should == 1 - Rspreadsheet::Tools.convert_cell_address('A1')[1].should == 1 - Rspreadsheet::Tools.convert_cell_address('C5')[0].should == 5 - Rspreadsheet::Tools.convert_cell_address('C5')[1].should == 3 - end -end - describe Rspreadsheet do it 'can open ods testfile and reads its content correctly' do book = Rspreadsheet.new($test_filename) s = book.worksheets[1] (1..10).each do |i| @@ -29,11 +20,11 @@ book2 = Rspreadsheet.new(tmp_filename) @sheet1 = book1.worksheets[1] @sheet2 = book2.worksheets[1] @sheet1.nonemptycells.each do |cell| # and test identity - @sheet2[cell.row,cell.col].should == cell.value + @sheet2[cell.rowi,cell.coli].should == cell.value end end it 'can open and save file, and saved file is exactly same as original' do tmp_filename = '/tmp/testfile1.ods' # first delete temp file File.delete(tmp_filename) if File.exists?(tmp_filename) @@ -59,12 +50,9 @@ book = Rspreadsheet.new($test_filename) # than open test file book.worksheets[1].rows(1).cells(1).value.should_not == 'xyzxyz' book.worksheets[1].rows(1).cells(1).value ='xyzxyz' book.worksheets[1].rows(1).cells(1).value.should == 'xyzxyz' -# book.worksheets[1][1,1].should_not == 'xyzxyz' -# book.worksheets[1][1,1]='xyzxyz' -# book.worksheets[1][1,1].should == 'xyzxyz' book.save(tmp_filename) # and save it as temp file # now compare them @content_doc1 = Zip::File.open($test_filename) do |zip| LibXML::XML::Document.io zip.get_input_stream('content.xml')