spec/worksheet_spec.rb in rspreadsheet-0.4.9 vs spec/worksheet_spec.rb in rspreadsheet-0.5.0
- old
+ new
@@ -62,10 +62,11 @@
@sheet.cells(2,2).value.should == 'test text'
@sheet.cells('B2').value.should == 'test text'
@sheet.cells('B','2').value.should == 'test text'
@sheet.cells(2,'B').value.should == 'test text'
+ expect { @sheet.cells(2,'B',2) }.to raise_error
end
it 'makes Cell object accessible' do
@sheet.cells(1,1).value = 'test text'
@sheet.cells(1,1).class.should == Rspreadsheet::Cell
end
@@ -98,8 +99,21 @@
expect { @sheet.rows(-1) }.to raise_error # default is to raise error
Rspreadsheet.raise_on_negative_coordinates = false
@sheet.rows(-1).should == nil # return nil if configured to do so
Rspreadsheet.raise_on_negative_coordinates = pom # reset the setting back
+ end
+ it 'needs string or XMLNode on creation' do
+ expect { Rspreadsheet::Worksheet.new(1.2345) }.to raise_error
+ end
+ it 'returns correct number of rows' do
+ @sheet.first_unused_row_index.should == 1
+ @sheet[5,7] = 'text into cell'
+ @sheet.first_unused_row_index.should == 6
+ @sheet[995,7] = 'text into cell'
+ @sheet.first_unused_row_index.should == 996
+ end
+ it 'does not implement the "return all cells" function yet' do
+ expect { @sheet.cell }.to raise_error
end
end
end