summaryrefslogtreecommitdiffstats
path: root/test/roo
diff options
context:
space:
mode:
Diffstat (limited to 'test/roo')
-rw-r--r--test/roo/test_base.rb4
-rw-r--r--test/roo/test_csv.rb28
2 files changed, 30 insertions, 2 deletions
diff --git a/test/roo/test_base.rb b/test/roo/test_base.rb
index 31ddb09..a9a4dd6 100644
--- a/test/roo/test_base.rb
+++ b/test/roo/test_base.rb
@@ -63,11 +63,11 @@ class TestRooBase < Minitest::Test
workbook.default_sheet = workbook.sheets.first
result = workbook.find 20
assert result
- assert_equal "Brief aus dem Sekretariat", result[0]["TITEL"]
+ assert_equal "Brief aus dem Sekretariat", result[0]
result = workbook.find 22
assert result
- assert_equal "Brief aus dem Skretariat. Tagung in Amberg/Opf.", result[0]["TITEL"]
+ assert_equal "Brief aus dem Skretariat. Tagung in Amberg/Opf.", result[0]
end
end
diff --git a/test/roo/test_csv.rb b/test/roo/test_csv.rb
index c5e251d..336191b 100644
--- a/test/roo/test_csv.rb
+++ b/test/roo/test_csv.rb
@@ -13,6 +13,34 @@ class TestRooCSV < Minitest::Test
end
end
+ def test_download_uri_with_query_string
+ file = filename("simple_spreadsheet")
+ port = 12_347
+ url = "#{local_server(port)}/#{file}?query-param=value"
+
+ start_local_server(file, port) do
+ csv = roo_class.new(url)
+ assert_equal "Task 1", csv.cell("f", 4)
+ assert_equal 1, csv.first_row
+ assert_equal 13, csv.last_row
+ assert_equal 1, csv.first_column
+ assert_equal 6, csv.last_column
+ end
+ end
+
+ def test_open_stream
+ file = filename("Bibelbund")
+ file_contents = File.read File.join(TESTDIR, file)
+ stream = StringIO.new(file_contents)
+ csv = roo_class.new(stream)
+
+ assert_equal "Aktuelle Seite", csv.cell("h", 12)
+ assert_equal 1, csv.first_row
+ assert_equal 3735, csv.last_row
+ assert_equal 1, csv.first_column
+ assert_equal 8, csv.last_column
+ end
+
def test_nil_rows_and_lines_csv
# x_123
oo = Roo::CSV.new(File.join(TESTDIR,'Bibelbund.csv'))