From 67ac5353a21f3bd46714f849d6cb56955d98cfca Mon Sep 17 00:00:00 2001 From: 433eros <115961721+433eros@users.noreply.github.com> Date: Mon, 28 Aug 2023 13:42:36 -0400 Subject: [PATCH] fix: Use URI.open to fix Kernel#open deprecation warning Fixes deprecation warning message: "/home/runner/work/rigse/rigse/rails/spec/support/solr_spec_helper.rb:23: warning: calling URI.open via Kernel#open is deprecated, call URI.open directly or use URI#open" See: https://github.com/concord-consortium/rigse/actions/runs/5728882369/job/15530837575#step:17:9 --- rails/spec/support/solr_spec_helper.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rails/spec/support/solr_spec_helper.rb b/rails/spec/support/solr_spec_helper.rb index aaf7d3af95..9ec9944a0b 100644 --- a/rails/spec/support/solr_spec_helper.rb +++ b/rails/spec/support/solr_spec_helper.rb @@ -1,3 +1,5 @@ +require 'open-uri' + $original_sunspot_session = Sunspot.session Sunspot.session = Sunspot::Rails::StubSessionProxy.new($original_sunspot_session) @@ -20,7 +22,7 @@ def reindex_all end def test_solr_server - open("http://#{SOLR_HOST}:#{SOLR_PORT}/") + URI.open("http://#{SOLR_HOST}:#{SOLR_PORT}/") end def solr_setup