summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorJurriaan Pruis <[email protected]>2014-02-26 20:17:13 +0100
committerJurriaan Pruis <[email protected]>2014-02-26 20:17:13 +0100
commit852586d08d757204f7b2ad424e273518ff17892c (patch)
tree383ec2e23fc0a14aa5ad90e139648a79814eeded /test
parenta271a7d0f26ecb26d01aad00e094744d6fe8b0d2 (diff)
parentbe8e00332c73439cf17083173ea74f1505100df9 (diff)
downloadcaxlsx-852586d08d757204f7b2ad424e273518ff17892c.tar.gz
caxlsx-852586d08d757204f7b2ad424e273518ff17892c.zip
Merge pull request #288 from jurriaan/refactoring
Huge refactoring
Diffstat (limited to 'test')
-rw-r--r--test/util/tc_simple_typed_list.rb3
-rw-r--r--test/workbook/worksheet/tc_cell.rb2
-rw-r--r--test/workbook/worksheet/tc_row.rb2
-rw-r--r--test/workbook/worksheet/tc_worksheet.rb7
4 files changed, 8 insertions, 6 deletions
diff --git a/test/util/tc_simple_typed_list.rb b/test/util/tc_simple_typed_list.rb
index d74cc9cc..1596ac13 100644
--- a/test/util/tc_simple_typed_list.rb
+++ b/test/util/tc_simple_typed_list.rb
@@ -72,7 +72,6 @@ class TestSimpleTypedList < Test::Unit::TestCase
def test_equality
@list.push 1
@list.push 2
- assert_equal(@list, [1,2])
-
+ assert_equal(@list.to_ary, [1,2])
end
end
diff --git a/test/workbook/worksheet/tc_cell.rb b/test/workbook/worksheet/tc_cell.rb
index baa7a9f1..e42cf09f 100644
--- a/test/workbook/worksheet/tc_cell.rb
+++ b/test/workbook/worksheet/tc_cell.rb
@@ -34,7 +34,7 @@ class TestCell < Test::Unit::TestCase
end
def test_pos
- assert_equal(@c.pos, [@c.index, @c.row.index])
+ assert_equal(@c.pos, [@c.index, @c.row.index(@c)])
end
def test_r
diff --git a/test/workbook/worksheet/tc_row.rb b/test/workbook/worksheet/tc_row.rb
index d847d475..8a057c26 100644
--- a/test/workbook/worksheet/tc_row.rb
+++ b/test/workbook/worksheet/tc_row.rb
@@ -29,7 +29,7 @@ class TestRow < Test::Unit::TestCase
def test_index
- assert_equal(@row.index, @row.worksheet.rows.index(@row))
+ assert_equal(@row.row_index, @row.worksheet.rows.index(@row))
end
def test_add_cell
diff --git a/test/workbook/worksheet/tc_worksheet.rb b/test/workbook/worksheet/tc_worksheet.rb
index 74253613..b399b306 100644
--- a/test/workbook/worksheet/tc_worksheet.rb
+++ b/test/workbook/worksheet/tc_worksheet.rb
@@ -398,10 +398,13 @@ class TestWorksheet < Test::Unit::TestCase
end
def test_to_xml_string_with_illegal_chars
+ old = Axlsx::trust_input
+ Axlsx::trust_input = false
nasties = "\v\u2028\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u001f"
@ws.add_row [nasties]
- assert_equal(0, @ws.rows.last.cells.last.value.index("\v"))
- assert_equal(nil,@ws.to_xml_string.index("\v"))
+ assert_equal(nil, @ws.rows.last.cells.last.value.index("\v"))
+ assert_equal(nil, @ws.to_xml_string.index("\v"))
+ Axlsx::trust_input = old
end
def test_to_xml_string_with_newlines