diff options
| author | 2022-03-19 21:48:07 -0400 | |
|---|---|---|
| committer | 2022-03-19 21:48:07 -0400 | |
| commit | a6e765da9b4da8cf9ddedcbaeb29fe5dca5df263 (patch) | |
| tree | 39a2e5d06c16d048e9618e1170e3b6304fbade2e /test/roo/test_excelx.rb | |
| parent | e67f4551479264125a641b955523d95e192b6d44 (diff) | |
| parent | f5fb17e5a64b215644bc104f099dad8c2f10c37d (diff) | |
Update upstream source from tag 'upstream/2.9.0'
Update to upstream version '2.9.0'
with Debian dir 41b8f9c552bbf25b076de11901d6f615d684366f
Diffstat (limited to 'test/roo/test_excelx.rb')
| -rw-r--r-- | test/roo/test_excelx.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/roo/test_excelx.rb b/test/roo/test_excelx.rb index 90c7167..61161f0 100644 --- a/test/roo/test_excelx.rb +++ b/test/roo/test_excelx.rb @@ -133,6 +133,20 @@ class TestRworkbookExcelx < Minitest::Test end end + def test_expand_merged_range_doesnt_insert_nil_values + options = { expand_merged_ranges: true } + xlsx = roo_class.new(File.join(TESTDIR, "merged_ranges.xlsx"), options) + + refute_includes xlsx.sheet_for(0).cells.values, nil, "`nil` was copied into the cells hash from an empty merged range" + end + + def test_expand_merged_range_doesnt_raise_issue_506 + # Issue 506 sent an example test.xlsx file that would raise an error upon parsing. + xl = Roo::Spreadsheet.open(File.join(TESTDIR, "expand_merged_ranges_issue_506.xlsx"), expand_merged_ranges: true) + data = xl.parse(one: /one/i, two: /two/i, clean: true) + assert_equal [{:one=>"John", :two=>"Johnson"}, {:one=>"Sam", :two=>nil}, {:one=>"Dave", :two=>nil}], data + end + def test_noexpand_merged_range xlsx = roo_class.new(File.join(TESTDIR, "merged_ranges.xlsx")) @@ -320,6 +334,13 @@ class TestRworkbookExcelx < Minitest::Test end end + def test_parsing_xlsx_with_richtext + xlsx = roo_class.new(File.join(TESTDIR, "richtext_example.xlsx")) + + assert_equal "Example richtext", xlsx.cell("a", 1) + assert_equal "Example richtext", xlsx.cell("b", 1) + end + def roo_class Roo::Excelx end |
