Skip to content

Commit 4581f4e

Browse files
committed
[test] Remove old Rubygems code not needed with integrated bundler
(cherry picked from commit 53a6629)
1 parent 2fe1782 commit 4581f4e

1 file changed

Lines changed: 3 additions & 21 deletions

File tree

src/spec/ruby/spec_helper.rb

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -76,27 +76,9 @@ def raise_logger(level = 'WARN')
7676
end
7777

7878
def gem_install_unless_installed(name, version)
79-
found = nil
80-
begin
81-
if Gem::Specification.respond_to? :find_all
82-
all = Gem::Specification.find_all
83-
found = all.find do |spec|
84-
spec.name == name && spec.version.to_s == version
85-
end
86-
elsif Gem::Specification.respond_to? :find_by_name
87-
found = Gem::Specification.find_by_name name, version
88-
else
89-
raise Gem::LoadError unless Gem.available? name, version
90-
end
91-
rescue Gem::LoadError
92-
found = false
93-
end
94-
# NOTE: won't ever be found in RubyGems >= 2.3 likely due Bundler
95-
unless found
96-
require 'rubygems/dependency_installer'
97-
installer = Gem::DependencyInstaller.new
98-
installer.install name, version
99-
end
79+
require 'rubygems/dependency_installer'
80+
installer = Gem::DependencyInstaller.new
81+
installer.install name, version
10082
end
10183

10284
ExpectationNotMetError = RSpec::Expectations::ExpectationNotMetError

0 commit comments

Comments
 (0)