Skip to content

Commit

Permalink
Whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
Empact committed Jul 21, 2012
1 parent 42cc96e commit 1a6e6c6
Showing 1 changed file with 28 additions and 28 deletions.
56 changes: 28 additions & 28 deletions test/test_roo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ class TestRoo < Test::Unit::TestCase
def test_internal_minutes
assert_equal 42*60, 42.minutes
end
# call a block of code for each spreadsheet type

# call a block of code for each spreadsheet type
# and yield a reference to the roo object
def with_each_spreadsheet(options)
# test if the spreadsheet type is valid :nodoc
Expand Down Expand Up @@ -161,7 +161,7 @@ def test_cells
end
end
end

def test_celltype
with_each_spreadsheet(:name=>'numbers1') do |oo|
assert_equal :string, oo.celltype(2,6)
Expand Down Expand Up @@ -407,7 +407,7 @@ def test_formula_excelx
assert_equal 42.5, oo.cell('A',17)
end
end

# Excel can only read the cell's value
def test_formula_excel
with_each_spreadsheet(:name=>'formula', :format=>:excel) do |oo|
Expand Down Expand Up @@ -850,7 +850,7 @@ def test_simple_spreadsheet_find_by_condition
assert_equal "Task 1" , erg[1]['Comment']
end
end

# Ruby-spreadsheet now allows us to at least give the current value
# from a cell with a formula (no possible with parseexcel)
def test_bug_false_borders_with_formulas
Expand Down Expand Up @@ -909,7 +909,7 @@ def get_extension(oo)
""
end
end

def test_info
expected_templ = "File: numbers1%s\n"+
"Number of sheets: 5\n"+
Expand Down Expand Up @@ -1379,7 +1379,7 @@ def test_datetime
assert_equal Date.new(1961,11,21), oo.cell('c',7)
end
end

def test_cell_openoffice_html_escape
with_each_spreadsheet(:name=>'html-escape', :format=>:openoffice) do |oo|
assert_equal "'", oo.cell(1,1)
Expand All @@ -1390,7 +1390,7 @@ def test_cell_openoffice_html_escape
# test_openoffice_zipped will catch issues with &quot;
end
end

def test_cell_boolean
with_each_spreadsheet(:name=>'boolean', :format=>[:openoffice, :excel, :excelx]) do |oo|
if oo.class == Roo::Excelx
Expand All @@ -1402,15 +1402,15 @@ def test_cell_boolean
end
end
end

def test_cell_multiline
with_each_spreadsheet(:name=>'paragraph', :format=>[:openoffice, :excel, :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_cell_styles
# styles only valid in excel spreadsheets?
# TODO: what todo with other spreadsheet types
Expand All @@ -1422,7 +1422,7 @@ def test_cell_styles
assert_equal true, oo.font(1,1).bold?
assert_equal false, oo.font(1,1).italic?
assert_equal false, oo.font(1,1).underline?

# italic
assert_equal false, oo.font(2,1).bold?
assert_equal true, oo.font(2,1).italic?
Expand Down Expand Up @@ -1474,7 +1474,7 @@ def test_cell_styles
assert_equal false, oo.font(11,4).underline?
end
end

# If a cell has a date-like string but is preceeded by a '
# to force that date to be treated like a string, we were getting an exception.
# This test just checks for that exception to make sure it's not raised in this case
Expand Down Expand Up @@ -1504,7 +1504,7 @@ def test_row_whitespace
assert_equal [Date.new(2007,5,7), nil, 10.75], oo.row(3)
end
end

def test_col_whitespace
#TODO:
# kein Zugriff auf Dokument whitespace
Expand Down Expand Up @@ -1551,7 +1551,7 @@ def test_base_dates_in_excel
assert_equal :date, oo.celltype(1,1)
end
end

def test_bad_date
with_each_spreadsheet(:name=>'prova', :format=>:excel) do |oo|
assert_nothing_raised(ArgumentError) {
Expand Down Expand Up @@ -1674,30 +1674,30 @@ def test_labeled_cells
end
assert_equal 5, row
assert_equal 3, col

row,col = oo.label('anton')
assert_equal 'Anton', oo.cell(row,col)

row,col = oo.label('berta')
assert_equal 'Bertha', oo.cell(row,col)

row,col = oo.label('caesar')
assert_equal 'Cäsar', oo.cell(row,col)

row,col = oo.label('never')
assert_nil row
assert_nil col

row,col,sheet = oo.label('anton')
assert_equal 5, row
assert_equal 3, col
assert_equal "Sheet1", sheet

assert_equal "Anton", oo.anton
assert_raises(NoMethodError) {
row,col = oo.never
}

# Reihenfolge row,col,sheet analog zu #label
assert_equal [
['anton',[5,3,'Sheet1']],
Expand Down Expand Up @@ -1817,7 +1817,7 @@ def test_bug_xlsx_reference_cell
assert_equal 'Teststring', xlsx.cell('a',2)
end
end

def test_bug_guest_list_2011_05_05
local_only do
oo = Roo::Excel.new(File.join("..","confidential","guest_list_addresses.xls"))
Expand Down Expand Up @@ -1967,7 +1967,7 @@ def test_bug_openoffice_formula_missing_letters
assert_equal '=SUM([.A1:.D1])', oo.formula('e',1)
assert_equal '=SUM([.A2:.D2])', oo.formula('e',2)
assert_equal '=SUM([.A3:.D3])', oo.formula('e',3)
assert_equal [
assert_equal [
[1,5,'=SUM([.A1:.D1])'],
[2,5,'=SUM([.A2:.D2])'],
[3,5,'=SUM([.A3:.D3])'],
Expand Down Expand Up @@ -2080,7 +2080,7 @@ def test_comments

## PREVIOUSLY SKIPPED

# don't have these test files so removing. We can easily add in
# don't have these test files so removing. We can easily add in
# by modifying with_each_spreadsheet
GNUMERIC_ODS = false # do gnumeric with ods files Tests?
OPENOFFICEWRITE = false # experimental: write access with OO-Documents
Expand Down Expand Up @@ -2121,7 +2121,7 @@ def test_writeopenoffice
File.join(TESTDIR,"numbers2.ods"))
end
end

def test_possible_bug_snowboard_borders #no test file
local_only do
if EXCEL
Expand Down Expand Up @@ -2443,8 +2443,8 @@ def test_huge_table_timing_10_000_openoffice #no test file
end
end
end
end
end

def test_bug_encoding_exported_from_google
if EXCEL
local_only do
Expand All @@ -2454,7 +2454,7 @@ def test_bug_encoding_exported_from_google
end
end
end

def test_invalid_iconv_from_ms
local_only do
#TODO: does only run within a darwin-environment
Expand Down

0 comments on commit 1a6e6c6

Please sign in to comment.