aboutsummaryrefslogtreecommitdiffstats
path: root/test/formatters
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@ubuntu.com>2019-01-14 01:40:56 -0500
committerLibravatarUnit 193 <unit193@ubuntu.com>2019-01-14 01:40:56 -0500
commitdddfa903d2b856146f05ffb4415c31d6127bb5bf (patch)
treee38c2aca92b54f06ccd0185f48dc47e3e1b3d77e /test/formatters
parent8280a21a23d44aa90177e2bc041d0b8dc8556f4b (diff)
New upstream version 2.8.0upstream/2.8.0
Diffstat (limited to 'test/formatters')
-rw-r--r--test/formatters/test_csv.rb17
-rw-r--r--test/formatters/test_xml.rb8
2 files changed, 21 insertions, 4 deletions
diff --git a/test/formatters/test_csv.rb b/test/formatters/test_csv.rb
index a4443f4..d47d93d 100644
--- a/test/formatters/test_csv.rb
+++ b/test/formatters/test_csv.rb
@@ -100,6 +100,23 @@ class TestRooFormatterCSV < Minitest::Test
end
end
+ def test_bug_datetime_offset_change
+ # DO NOT REMOVE Asia/Calcutta
+ [nil, "US/Eastern", "US/Pacific", "Asia/Calcutta"].each do |zone|
+ with_timezone(zone) do
+ with_each_spreadsheet(name: "datetime_timezone_ist_offset_change", format: %i[excelx openoffice libreoffice]) do |workbook|
+ Dir.mktmpdir do |tempdir|
+ datetime_csv_file = File.join(tempdir, "datetime_timezone_ist_offset_change.csv")
+
+ assert workbook.to_csv(datetime_csv_file)
+ assert File.exist?(datetime_csv_file)
+ assert_equal "", file_diff("#{TESTDIR}/so_datetime_timezone_ist_offset_change.csv", datetime_csv_file)
+ end
+ end
+ end
+ end
+ end
+
def test_true_class
assert_equal "true", cell_to_csv(1, 1)
end
diff --git a/test/formatters/test_xml.rb b/test/formatters/test_xml.rb
index c8390b6..ef904ec 100644
--- a/test/formatters/test_xml.rb
+++ b/test/formatters/test_xml.rb
@@ -16,7 +16,7 @@ class TestRooFormatterXML < Minitest::Test
all_cells = init_all_cells(workbook, sheetname)
cells = xml_sheet.children.reject(&:text?)
- assert_equal sheetname, xml_sheet.attribute("name").value
+ assert_equal sheetname, xml_sheet["name"]
assert_equal all_cells.size, cells.size
cells.each_with_index do |cell, i|
@@ -27,10 +27,10 @@ class TestRooFormatterXML < Minitest::Test
all_cells[i][:type],
]
result = [
- cell.attribute("row").value,
- cell.attribute("column").value,
+ cell["row"],
+ cell["column"],
cell.text,
- cell.attribute("type").value,
+ cell["type"],
]
assert_equal expected, result