Skip to content
This repository
Browse code

extend whitespace tests to other formats

  • Loading branch information...
commit 45e37e0acd59b4357ff62cadf6df7097b0fca2ff 1 parent bdab2fa
Hugh McGowan authored June 28, 2009
24  test/test_roo.rb
@@ -64,6 +64,7 @@ def key_of(spreadsheetname)
64 64
         "only_one_sheet" => "rqRtkcPJ97nhQ0m9ksDw2rA",
65 65
         'time-test' => 'r2XfDBJMrLPjmuLrPQQrEYw',
66 66
         'datetime' => "r2kQpXWr6xOSUpw9MyXavYg",
  67
+        'whitespace' => "rZyQaoFebVGeHKzjG6e9gRQ"
67 68
       }[spreadsheetname]
68 69
         # 'numbers1' => "o10837434939102457526.4784396906364855777",
69 70
         # 'borders' => "o10837434939102457526.664868920231926255",
@@ -1076,11 +1077,7 @@ def test_huge_document_to_csv
1076 1077
 
1077 1078
   def test_to_csv
1078 1079
     with_each_spreadsheet(:name=>'numbers1') do |oo|
1079  
-      if oo.class == Excel
1080  
-        master = "#{TESTDIR}/numbers1_excel.csv"
1081  
-      else    
1082  
-        master = "#{TESTDIR}/numbers1.csv"
1083  
-      end
  1080
+      master = "#{TESTDIR}/numbers1.csv"
1084 1081
       File.delete_if_exist("/tmp/numbers1.csv")
1085 1082
       oo.default_sheet = oo.sheets.first if oo.class == Google
1086 1083
       assert oo.to_csv("/tmp/numbers1.csv",oo.sheets.first)
@@ -1365,20 +1362,13 @@ def test_simple_spreadsheet_find_by_condition
1365 1362
     end
1366 1363
   end
1367 1364
   
  1365
+  # Ruby-spreadsheet now allows us to at least give the current value 
  1366
+  # from a cell with a formula (no possible with parseexcel)
1368 1367
   def test_bug_false_borders_with_formulas
1369 1368
     with_each_spreadsheet(:name=>'false_encoding', :format=>:excel) do |oo|
1370 1369
       after Date.new(2008,9,15) do
1371 1370
         oo.default_sheet = oo.sheets.first
1372  
-        #assert_equal 1, oo.first_row
1373  
-=begin
1374  
-  korrigiert auf Zeile 2. Zeile 1 enthaelt nur Formeln, die in parseexcel nicht
1375  
-  ausgewertet werden koennen. D. h. der Nutzer hat keinen Vorteil davon, wenn
1376  
-  er von Zeile 1 ab iterieren kann, da er auf die Formeln sowieso nicht zugreifen
1377  
-  kann. Ideal waere aber noch eine Loesung, die auch diese Zeilen bei Excel
1378  
-  als nichtleere Zeile liefert.
1379  
-  TODO:
1380  
-=end
1381  
-        assert_equal 2, oo.first_row
  1371
+        assert_equal 1, oo.first_row
1382 1372
         assert_equal 3, oo.last_row
1383 1373
         assert_equal 1, oo.first_column
1384 1374
         assert_equal 4, oo.last_column
@@ -2095,7 +2085,7 @@ def test_date_to_float_conversion
2095 2085
 
2096 2086
 # Need to extend to other formats
2097 2087
   def test_row_whitespace
2098  
-    with_each_spreadsheet(:name=>'whitespace', :format=>:openoffice) do |oo|    
  2088
+    with_each_spreadsheet(:name=>'whitespace') do |oo| 
2099 2089
       oo.default_sheet = "Sheet1"
2100 2090
       assert_equal [nil, nil, nil, nil, nil, nil], oo.row(1)
2101 2091
       assert_equal [nil, nil, nil, nil, nil, nil], oo.row(2)
@@ -2111,7 +2101,7 @@ def test_row_whitespace
2111 2101
   end
2112 2102
   
2113 2103
   def test_col_whitespace
2114  
-    with_each_spreadsheet(:name=>'whitespace', :format=>:openoffice) do |oo|    
  2104
+    with_each_spreadsheet(:name=>'whitespace') do |oo|    
2115 2105
       oo.default_sheet = "Sheet1"
2116 2106
       assert_equal ["Date", Date.new(2007,5,7), nil, Date.new(2007,5,7)], oo.column(1)
2117 2107
       assert_equal ["Start time", 9.25, nil, 10.75], oo.column(2)
BIN  test/whitespace.xls
Binary file not shown
BIN  test/whitespace.xlsx
Binary file not shown

0 notes on commit 45e37e0

Please sign in to comment.
Something went wrong with that request. Please try again.