From 5fc437877a9a82aed6f7ddbbdee99b00bcf9dc88 Mon Sep 17 00:00:00 2001 From: chopraanmol1 Date: Mon, 8 Oct 2018 11:28:58 +0530 Subject: [PATCH] Fix TestRooCSV#test_download_uri_with_query_string TestRooCSV#test_download_uri_with_query_string sometimes raises Net::ReadTimeout. Used a smaller file to prevent this exception. --- test/files/simple_spreadsheet.csv | 13 +++++++++++++ test/roo/test_csv.rb | 8 ++++---- 2 files changed, 17 insertions(+), 4 deletions(-) create mode 100644 test/files/simple_spreadsheet.csv diff --git a/test/files/simple_spreadsheet.csv b/test/files/simple_spreadsheet.csv new file mode 100644 index 00000000..fc4ab6b8 --- /dev/null +++ b/test/files/simple_spreadsheet.csv @@ -0,0 +1,13 @@ +,,,,, +,,,,, +Date,Start time,End time,Pause,Sum,Comment +2007-05-07,9.25,10.25,0,1,Task 1 +2007-05-07,10.75,12.50,0,1.75,Task 1 +2007-05-07,18.00,19.00,0,1,Task 2 +2007-05-08,9.25,10.25,0,1,Task 2 +2007-05-08,14.50,15.50,0,1,Task 3 +2007-05-08,8.75,9.25,0,0.5,Task 3 +2007-05-14,21.75,22.25,0,0.5,Task 3 +2007-05-14,22.50,23.00,0,0.5,Task 3 +2007-05-15,11.75,12.75,0,1,Task 3 +2007-05-07,10.75,10.75,0,0,Task 1 diff --git a/test/roo/test_csv.rb b/test/roo/test_csv.rb index 16fa6911..c51b019d 100644 --- a/test/roo/test_csv.rb +++ b/test/roo/test_csv.rb @@ -14,17 +14,17 @@ def test_sheets end def test_download_uri_with_query_string - file = filename("Bibelbund") + file = filename("simple_spreadsheet") port = 12_344 url = "#{local_server(port)}/#{file}?query-param=value" start_local_server(file, port) do csv = roo_class.new(url) - assert_equal "Aktuelle Seite", csv.cell("h", 12) + assert_equal "Task 1", csv.cell("f", 4) assert_equal 1, csv.first_row - assert_equal 3735, csv.last_row + assert_equal 13, csv.last_row assert_equal 1, csv.first_column - assert_equal 8, csv.last_column + assert_equal 6, csv.last_column end end