spec/cell_spec.rb in rspreadsheet-0.4.4 vs spec/cell_spec.rb in rspreadsheet-0.4.5
- old
+ new
@@ -450,6 +450,27 @@
end
it 'automatically creates new style, if a style is automatic, some of its attributes changes and there are several cells pointing to it', :penting=>'' do
end
+
+ it 'gracedully accepts nil in assignement' do
+ expect {
+ @sheet2.cell('B1').value = nil
+ @sheet2.cell('B2').value = nil
+ @sheet2.cell('B3').value = nil
+ @sheet2.cell('B22').value = nil
+ @sheet2.cell('D22').value = nil
+ @sheet2.cell('F22').value = nil
+ }.not_to raise_error
+ end
+ it 'can be inserted before existing cell and this one is shifted right' do
+ @sheet1.B2 = 'test'
+ @sheet1.B2.should == 'test'
+ inscell = @sheet1.insert_cell_before(2,2)
+ inscell.value = 'new'
+ @sheet1.B2.should == 'new'
+ @sheet1.C2.should == 'test'
+ inscell = @sheet1.insert_cell_before(2,4) # should not move cells with data
+ @sheet1.C2.should == 'test'
+ end
end