Navigation Menu

Skip to content

Commit

Permalink
Carry paragraph tests to other formats
Browse files Browse the repository at this point in the history
  • Loading branch information
--unset committed Apr 20, 2009
1 parent a33ec58 commit 4e36a77
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion lib/roo/openoffice.rb
Expand Up @@ -306,7 +306,7 @@ def read_cells(sheet=nil)
str_v += children_to_string(str.children)
else
str.children.each do |child|
str_v = str_v + child.content #.text
str_v += child.content #.text
end
end
str_v.gsub!(/'/,"'") # special case not supported by unescapeHTML
Expand Down
26 changes: 14 additions & 12 deletions test/test_roo.rb
Expand Up @@ -4869,25 +4869,27 @@ def test_cell_boolean
end

def test_cell_multiline
# if EXCEL
# oo = Excel.new(File.join(TESTDIR,"boolean.xls"))
# oo.default_sheet = oo.sheets.first
# assert_equal "true", oo.cell(1,1)
# assert_equal "false", oo.cell(2,1)
# end
if EXCEL
oo = Excel.new(File.join(TESTDIR,"paragraph.xls"))
oo.default_sheet = oo.sheets.first
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
if OPENOFFICE
oo = Openoffice.new(File.join(TESTDIR,"paragraph.ods"))
oo.default_sheet = oo.sheets.first
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
# if EXCELX
# oo = Excelx.new(File.join(TESTDIR,"boolean.xlsx"))
# oo.default_sheet = oo.sheets.first
# assert_equal "TRUE", oo.cell(1,1)
# assert_equal "FALSE", oo.cell(2,1)
# end
if EXCELX
oo = Excelx.new(File.join(TESTDIR,"paragraph.xlsx"))
oo.default_sheet = oo.sheets.first
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


Expand Down

0 comments on commit 4e36a77

Please sign in to comment.