test/test_roo.rb in roo-2.9.0 vs test/test_roo.rb in roo-2.10.0
- old
+ new
@@ -272,14 +272,44 @@
assert_equal "false", oo.cell(2,1), "failure in "+oo.class.to_s
end
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)
assert_equal "This is a test\n¶\nof a multiline\n\nCell", oo.cell(1,2)
assert_equal "first p\n\nsecond p\n\nlast p", oo.cell(2,1)
+ 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: