aboutsummaryrefslogtreecommitdiffstats
path: root/test/roo/test_csv.rb
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@ubuntu.com>2019-01-14 01:41:26 -0500
committerLibravatarUnit 193 <unit193@ubuntu.com>2019-01-14 01:41:26 -0500
commit6aa7e04e06423e7d92ede727489ea346e88f7108 (patch)
tree9bdec92fd17898b662235bc0a491de827990130c /test/roo/test_csv.rb
parentc59817e300dbe1aab3120cad603cdb14b14ed78b (diff)
parentdddfa903d2b856146f05ffb4415c31d6127bb5bf (diff)
Update upstream source from tag 'upstream/2.8.0'
Update to upstream version '2.8.0' with Debian dir 569f5866fbcf4e449c6c48dc5d20a3ab54f95252
Diffstat (limited to 'test/roo/test_csv.rb')
-rw-r--r--test/roo/test_csv.rb28
1 files changed, 28 insertions, 0 deletions
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'))