diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/files/apostrophe.ods | bin | 0 -> 8583 bytes | |||
| -rw-r--r-- | test/files/boolean-from-google-sheets.ods | bin | 0 -> 8099 bytes | |||
| -rw-r--r-- | test/files/boolean-from-google-sheets.xlsx | bin | 0 -> 4665 bytes | |||
| -rw-r--r-- | test/files/currency-euro.xlsx | bin | 0 -> 499104 bytes | |||
| -rw-r--r-- | test/files/currency-uk.xlsx | bin | 0 -> 499099 bytes | |||
| -rw-r--r-- | test/files/currency-us.xlsx | bin | 0 -> 499043 bytes | |||
| -rw-r--r-- | test/files/frozen_string.ods | bin | 0 -> 1219 bytes | |||
| -rw-r--r-- | test/files/implicit_coordinates.xlsx | bin | 0 -> 4405 bytes | |||
| -rw-r--r-- | test/files/wrong_coordinates.xlsx | bin | 0 -> 11327 bytes | |||
| -rw-r--r-- | test/roo/test_excelx.rb | 9 | ||||
| -rw-r--r-- | test/test_roo.rb | 30 |
11 files changed, 39 insertions, 0 deletions
diff --git a/test/files/apostrophe.ods b/test/files/apostrophe.ods Binary files differnew file mode 100644 index 0000000..9a4e4a6 --- /dev/null +++ b/test/files/apostrophe.ods diff --git a/test/files/boolean-from-google-sheets.ods b/test/files/boolean-from-google-sheets.ods Binary files differnew file mode 100644 index 0000000..246a5a8 --- /dev/null +++ b/test/files/boolean-from-google-sheets.ods diff --git a/test/files/boolean-from-google-sheets.xlsx b/test/files/boolean-from-google-sheets.xlsx Binary files differnew file mode 100644 index 0000000..7801156 --- /dev/null +++ b/test/files/boolean-from-google-sheets.xlsx diff --git a/test/files/currency-euro.xlsx b/test/files/currency-euro.xlsx Binary files differnew file mode 100644 index 0000000..c160836 --- /dev/null +++ b/test/files/currency-euro.xlsx diff --git a/test/files/currency-uk.xlsx b/test/files/currency-uk.xlsx Binary files differnew file mode 100644 index 0000000..8b709dd --- /dev/null +++ b/test/files/currency-uk.xlsx diff --git a/test/files/currency-us.xlsx b/test/files/currency-us.xlsx Binary files differnew file mode 100644 index 0000000..a11dfa5 --- /dev/null +++ b/test/files/currency-us.xlsx diff --git a/test/files/frozen_string.ods b/test/files/frozen_string.ods Binary files differnew file mode 100644 index 0000000..55e0e1b --- /dev/null +++ b/test/files/frozen_string.ods diff --git a/test/files/implicit_coordinates.xlsx b/test/files/implicit_coordinates.xlsx Binary files differnew file mode 100644 index 0000000..039d018 --- /dev/null +++ b/test/files/implicit_coordinates.xlsx diff --git a/test/files/wrong_coordinates.xlsx b/test/files/wrong_coordinates.xlsx Binary files differnew file mode 100644 index 0000000..0c6614e --- /dev/null +++ b/test/files/wrong_coordinates.xlsx diff --git a/test/roo/test_excelx.rb b/test/roo/test_excelx.rb index 61161f0..c90cd8c 100644 --- a/test/roo/test_excelx.rb +++ b/test/roo/test_excelx.rb @@ -341,6 +341,15 @@ class TestRworkbookExcelx < Minitest::Test assert_equal "Example richtext", xlsx.cell("b", 1) end + def test_implicit_coordinates + xlsx = roo_class.new(File.join(TESTDIR, 'implicit_coordinates.xlsx')) + + assert_equal 'Test', xlsx.cell('a', 1) + assert_equal 'A2', xlsx.cell('a', 2) + assert_equal 'B2', xlsx.cell(2, 2) + assert_equal 'C2', xlsx.cell('c', 2) + end + def roo_class Roo::Excelx end diff --git a/test/test_roo.rb b/test/test_roo.rb index dae4a41..bd1188d 100644 --- a/test/test_roo.rb +++ b/test/test_roo.rb @@ -274,6 +274,24 @@ class TestRoo < Minitest::Test end end + def test_cell_boolean_from_google_sheets + with_each_spreadsheet(:name=>'boolean-from-google-sheets', :format=>[:openoffice, :excelx]) do |oo| + if oo.class == Roo::Excelx + assert_equal true, oo.cell(1, 1), "failure in #{oo.class}" + assert_equal false, oo.cell(2, 1), "failure in #{oo.class}" + + cell = oo.sheet_for(oo.default_sheet).cells[[1, 1,]] + assert_equal 'TRUE', cell.formatted_value + + cell = oo.sheet_for(oo.default_sheet).cells[[2, 1,]] + assert_equal 'FALSE', cell.formatted_value + else + assert_equal "true", oo.cell(1,1), "failure in #{oo.class}" + assert_equal "false", oo.cell(2,1), "failure in #{oo.class}" + end + end + end + def test_cell_multiline with_each_spreadsheet(:name=>'paragraph', :format=>[:openoffice, :excelx]) do |oo| assert_equal "This is a test\nof a multiline\nCell", oo.cell(1,1) @@ -282,6 +300,18 @@ class TestRoo < Minitest::Test end end + def test_apostrophe_replacement + with_each_spreadsheet(:name=>'apostrophe', :format=>[:openoffice]) do |oo| + assert_equal "'", oo.cell(1,1) + end + end + + def test_frozen_string_usage + with_each_spreadsheet(:name=>'frozen_string', :format=>[:openoffice]) do |oo| + assert_equal "", oo.cell(1,1) + end + end + def test_row_whitespace # auf dieses Dokument habe ich keinen Zugriff TODO: # TODO: No access to document whitespace? |
