diff options
| author | Randy Morgan <[email protected]> | 2012-01-13 18:56:38 +0900 |
|---|---|---|
| committer | Randy Morgan <[email protected]> | 2012-01-13 18:56:38 +0900 |
| commit | c3459ef98ee4ede887d28dfacd1c0d62e0cddd29 (patch) | |
| tree | 17c04ff769676454f2d9ec40e1e615a63191014d /test | |
| parent | c16ba34f2165712f37470d127039beb8343f8cfe (diff) | |
| download | caxlsx-c3459ef98ee4ede887d28dfacd1c0d62e0cddd29.tar.gz caxlsx-c3459ef98ee4ede887d28dfacd1c0d62e0cddd29.zip | |
applying col_style to a list of rows of unequal length can cause an error as there is no cell at the index.
for example, with a structure like this:
********
**
********
***
col_style 2, 1
would fail as the second row has no cell at index 2.
Thanks Don!
https://github.com/randym/axlsx/issues/15
Diffstat (limited to 'test')
| -rw-r--r-- | test/workbook/worksheet/tc_worksheet.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/workbook/worksheet/tc_worksheet.rb b/test/workbook/worksheet/tc_worksheet.rb index 4722a999..24e26155 100644 --- a/test/workbook/worksheet/tc_worksheet.rb +++ b/test/workbook/worksheet/tc_worksheet.rb @@ -69,6 +69,13 @@ class TestWorksheet < Test::Unit::TestCase assert_equal(@ws.rows.first.cells[0].style, 0) end + def test_col_style_with_empty_column + @ws.add_row [1,2,3,4] + @ws.add_row [1] + @ws.add_row [1,2,3,4] + assert_nothing_raised {@ws.col_style(1, 1)} + end + def test_cols @ws.add_row [1,2,3,4] @ws.add_row [1,2,3,4] |
