spec/downloader_spec.rb in oddb2xml-2.5.9 vs spec/downloader_spec.rb in oddb2xml-2.6.0

- old
+ new

@@ -215,13 +215,13 @@ Oddb2xml::GTINS_DRUGS.each{ |x| next unless x.to_s.size == 13; drugs << [x.to_s[4..8].to_i, x.to_s[9..11].to_i] }; idx = 6; to_delete = [] puts "#{Time.now}: Finding items to delete will take some time" while (worksheet.sheet_data[idx]) idx += 1 - next unless worksheet.sheet_data[idx-1][Oddb2xml::COLUMNS_JULY_2015.keys.index(:iksnr)] - to_delete << (idx-1) unless drugs.find{ |x| x[0]== worksheet.sheet_data[idx-1][Oddb2xml::COLUMNS_JULY_2015.keys.index(:iksnr)].value.to_i and - x[1]== worksheet.sheet_data[idx-1][Oddb2xml::COLUMNS_JULY_2015.keys.index(:ikscd)].value.to_i + next unless worksheet.sheet_data[idx-1][Oddb2xml::COLUMNS_FEBRUARY_2019.keys.index(:iksnr)] + to_delete << (idx-1) unless drugs.find{ |x| x[0]== worksheet.sheet_data[idx-1][Oddb2xml::COLUMNS_FEBRUARY_2019.keys.index(:iksnr)].value.to_i and + x[1]== worksheet.sheet_data[idx-1][Oddb2xml::COLUMNS_FEBRUARY_2019.keys.index(:ikscd)].value.to_i } end if to_delete.size > 0 puts "#{Time.now}: Deleting #{to_delete.size} of the #{idx} items will take some time" to_delete.reverse.each{ |row_id| worksheet.delete_row(row_id) } @@ -235,9 +235,10 @@ end describe Oddb2xml::SwissmedicDownloader do include ServerMockHelper before(:each) do + mock_downloads VCR.configure do |c| c.before_record(:swissmedic) do |i| config = c info = i begin